mantis-cli 22.3.0__tar.gz → 22.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {mantis_cli-22.3.0/mantis_cli.egg-info → mantis_cli-22.4.0}/PKG-INFO +4 -23
  2. mantis_cli-22.4.0/mantis/__init__.py +1 -0
  3. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/managers.py +12 -2
  4. {mantis_cli-22.3.0 → mantis_cli-22.4.0/mantis_cli.egg-info}/PKG-INFO +5 -24
  5. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis_cli.egg-info/entry_points.txt +1 -0
  6. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_managers.py +35 -0
  7. mantis_cli-22.3.0/mantis/__init__.py +0 -1
  8. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/LICENSE +0 -0
  9. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/MANIFEST.in +0 -0
  10. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/README.md +0 -0
  11. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/__main__.py +0 -0
  12. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/app.py +0 -0
  13. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/command_line.py +0 -0
  14. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/__init__.py +0 -0
  15. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/compose.py +0 -0
  16. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/configuration.py +0 -0
  17. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/connection.py +0 -0
  18. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/containers.py +0 -0
  19. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/core.py +0 -0
  20. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/django.py +0 -0
  21. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/images.py +0 -0
  22. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/nginx.py +0 -0
  23. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/postgres.py +0 -0
  24. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/secrets.py +0 -0
  25. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/services.py +0 -0
  26. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/commands/volumes.py +0 -0
  27. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/config.py +0 -0
  28. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/cryptography.py +0 -0
  29. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/environment.py +0 -0
  30. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/extensions/__init__.py +0 -0
  31. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/extensions/django.py +0 -0
  32. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/extensions/nginx.py +0 -0
  33. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/extensions/postgres.py +0 -0
  34. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/helpers.py +0 -0
  35. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/mantis.tpl +0 -0
  36. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis/schema.py +0 -0
  37. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis_cli.egg-info/SOURCES.txt +0 -0
  38. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis_cli.egg-info/dependency_links.txt +0 -0
  39. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis_cli.egg-info/requires.txt +0 -0
  40. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/mantis_cli.egg-info/top_level.txt +0 -0
  41. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/setup.cfg +0 -0
  42. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/setup.py +0 -0
  43. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/__init__.py +0 -0
  44. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_build_config.py +0 -0
  45. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_command_line.py +0 -0
  46. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_config.py +0 -0
  47. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_helpers.py +0 -0
  48. {mantis_cli-22.3.0 → mantis_cli-22.4.0}/tests/test_tunnel.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: mantis_cli
3
- Version: 22.3.0
3
+ Version: 22.4.0
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -9,6 +9,7 @@ Maintainer: Pragmatic Mates
9
9
  Maintainer-email: info@pragmaticmates.com
10
10
  License: GNU General Public License (GPL)
11
11
  Keywords: management deployment docker command
12
+ Platform: UNKNOWN
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Operating System :: OS Independent
14
15
  Classifier: Environment :: Web Environment
@@ -18,27 +19,6 @@ Classifier: License :: OSI Approved :: GNU General Public License (GPL)
18
19
  Classifier: Development Status :: 5 - Production/Stable
19
20
  Description-Content-Type: text/markdown
20
21
  License-File: LICENSE
21
- Requires-Dist: cffi
22
- Requires-Dist: click
23
- Requires-Dist: cryptography
24
- Requires-Dist: pycryptodome
25
- Requires-Dist: pydantic
26
- Requires-Dist: PyYAML
27
- Requires-Dist: rich
28
- Requires-Dist: typer
29
- Dynamic: author
30
- Dynamic: author-email
31
- Dynamic: classifier
32
- Dynamic: description
33
- Dynamic: description-content-type
34
- Dynamic: home-page
35
- Dynamic: keywords
36
- Dynamic: license
37
- Dynamic: license-file
38
- Dynamic: maintainer
39
- Dynamic: maintainer-email
40
- Dynamic: requires-dist
41
- Dynamic: summary
42
22
 
43
23
  # mantis-cli
44
24
 
@@ -611,3 +591,4 @@ Works as follows:
611
591
  ## Release notes
612
592
 
613
593
  Mantis uses semantic versioning. See more in [changelog](https://github.com/PragmaticMates/mantis-cli/blob/master/CHANGES.md).
594
+
@@ -0,0 +1 @@
1
+ VERSION = '22.4.0'
@@ -521,6 +521,16 @@ class AbstractManager(object):
521
521
  except OSError as e:
522
522
  CLI.error(f"{error_message}: {e}")
523
523
 
524
+ @property
525
+ def quiet_flag(self) -> str:
526
+ """
527
+ Layer progress is meant to be repainted in place, which needs a terminal. Redirected
528
+ to a log file or a CI pipe, docker prints every progress event on its own line
529
+ instead -- hundreds per image -- so ask for no progress at all when there is nobody
530
+ to watch it move. Errors and the final result are not progress and still print.
531
+ """
532
+ return '' if sys.stdout.isatty() else '--quiet'
533
+
524
534
  def build_docker_command(self, command: str, use_connection: bool = True) -> str:
525
535
  docker_connection = self.docker_connection if use_connection else ''
526
536
 
@@ -1229,7 +1239,7 @@ class BaseManager(AbstractManager):
1229
1239
  CLI.info(f'Services = {params}')
1230
1240
 
1231
1241
  # Push using docker compose
1232
- self.docker_compose(f'push {params}', use_connection=False)
1242
+ self.docker_compose(f'push {self.quiet_flag} {params}', use_connection=False)
1233
1243
 
1234
1244
  def pull(self, services: Optional[List[str]] = None) -> None:
1235
1245
  """
@@ -1240,7 +1250,7 @@ class BaseManager(AbstractManager):
1240
1250
  CLI.info(f'Services = {params}')
1241
1251
 
1242
1252
  # Pull using docker compose
1243
- self.docker_compose(f'pull {params}')
1253
+ self.docker_compose(f'pull {self.quiet_flag} {params}')
1244
1254
 
1245
1255
  def upload(self) -> None:
1246
1256
  """
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
2
- Name: mantis_cli
3
- Version: 22.3.0
1
+ Metadata-Version: 2.1
2
+ Name: mantis-cli
3
+ Version: 22.4.0
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -9,6 +9,7 @@ Maintainer: Pragmatic Mates
9
9
  Maintainer-email: info@pragmaticmates.com
10
10
  License: GNU General Public License (GPL)
11
11
  Keywords: management deployment docker command
12
+ Platform: UNKNOWN
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Operating System :: OS Independent
14
15
  Classifier: Environment :: Web Environment
@@ -18,27 +19,6 @@ Classifier: License :: OSI Approved :: GNU General Public License (GPL)
18
19
  Classifier: Development Status :: 5 - Production/Stable
19
20
  Description-Content-Type: text/markdown
20
21
  License-File: LICENSE
21
- Requires-Dist: cffi
22
- Requires-Dist: click
23
- Requires-Dist: cryptography
24
- Requires-Dist: pycryptodome
25
- Requires-Dist: pydantic
26
- Requires-Dist: PyYAML
27
- Requires-Dist: rich
28
- Requires-Dist: typer
29
- Dynamic: author
30
- Dynamic: author-email
31
- Dynamic: classifier
32
- Dynamic: description
33
- Dynamic: description-content-type
34
- Dynamic: home-page
35
- Dynamic: keywords
36
- Dynamic: license
37
- Dynamic: license-file
38
- Dynamic: maintainer
39
- Dynamic: maintainer-email
40
- Dynamic: requires-dist
41
- Dynamic: summary
42
22
 
43
23
  # mantis-cli
44
24
 
@@ -611,3 +591,4 @@ Works as follows:
611
591
  ## Release notes
612
592
 
613
593
  Mantis uses semantic versioning. See more in [changelog](https://github.com/PragmaticMates/mantis-cli/blob/master/CHANGES.md).
594
+
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  mantis = mantis.command_line:run
3
+
@@ -512,3 +512,38 @@ class TestResolveContainers:
512
512
  manager.get_containers = lambda *args, **kwargs: pytest.fail('containers listed again')
513
513
 
514
514
  assert manager.resolve_container('app', ['itfitness-app']) == 'itfitness-app'
515
+
516
+
517
+ class TestQuietProgress:
518
+ """Layer progress is repainted in place, which only works on a terminal."""
519
+
520
+ @staticmethod
521
+ def _manager():
522
+ manager = BaseManager.__new__(BaseManager)
523
+ manager.commands = []
524
+ manager.docker_compose = lambda command, **kwargs: manager.commands.append(
525
+ ' '.join(command.split())
526
+ )
527
+ return manager
528
+
529
+ @patch('sys.stdout', new_callable=MagicMock)
530
+ def test_push_and_pull_are_quiet_off_a_terminal(self, mock_stdout):
531
+ """A log file or a CI pipe would otherwise get every progress event as its own line."""
532
+ mock_stdout.isatty.return_value = False
533
+ manager = self._manager()
534
+
535
+ manager.push()
536
+ manager.pull()
537
+
538
+ assert manager.commands == ['push --quiet', 'pull --quiet']
539
+
540
+ @patch('sys.stdout', new_callable=MagicMock)
541
+ def test_push_and_pull_keep_progress_on_a_terminal(self, mock_stdout):
542
+ """Interactively the progress is the point, so nothing changes."""
543
+ mock_stdout.isatty.return_value = True
544
+ manager = self._manager()
545
+
546
+ manager.push(['app'])
547
+ manager.pull(['app'])
548
+
549
+ assert manager.commands == ['push app', 'pull app']
@@ -1 +0,0 @@
1
- VERSION = '22.3.0'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes