dev-shell 0.10.2__tar.gz → 0.11.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 (39) hide show
  1. {dev_shell-0.10.2 → dev_shell-0.11.0}/.gitignore +10 -7
  2. {dev_shell-0.10.2 → dev_shell-0.11.0}/.pre-commit-config.yaml +1 -1
  3. {dev_shell-0.10.2 → dev_shell-0.11.0}/PKG-INFO +18 -7
  4. {dev_shell-0.10.2 → dev_shell-0.11.0}/README.md +17 -6
  5. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/__init__.py +1 -1
  6. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/base_cmd2_app.py +1 -1
  7. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/bootstrap-source.py +5 -2
  8. dev_shell-0.11.0/dev_shell/command_sets/__init__.py +43 -0
  9. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/command_sets/dev_shell_commands.py +0 -1
  10. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/dev_shell_app.py +8 -8
  11. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/__init__.py +2 -2
  12. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_readme.py +10 -2
  13. {dev_shell-0.10.2 → dev_shell-0.11.0}/devshell.py +5 -2
  14. {dev_shell-0.10.2 → dev_shell-0.11.0}/noxfile.py +1 -0
  15. {dev_shell-0.10.2 → dev_shell-0.11.0}/pyproject.toml +1 -0
  16. dev_shell-0.10.2/dev_shell/command_sets/__init__.py +0 -10
  17. dev_shell-0.10.2/uv.lock +0 -1634
  18. {dev_shell-0.10.2 → dev_shell-0.11.0}/.editorconfig +0 -0
  19. {dev_shell-0.10.2 → dev_shell-0.11.0}/.github/workflows/tests.yml +0 -0
  20. {dev_shell-0.10.2 → dev_shell-0.11.0}/.idea/.gitignore +0 -0
  21. {dev_shell-0.10.2 → dev_shell-0.11.0}/.pre-commit-hooks.yaml +0 -0
  22. {dev_shell-0.10.2 → dev_shell-0.11.0}/.run/Template Python tests.run.xml +0 -0
  23. {dev_shell-0.10.2 → dev_shell-0.11.0}/.run/Unittests __all__.run.xml +0 -0
  24. {dev_shell-0.10.2 → dev_shell-0.11.0}/LICENSE +0 -0
  25. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/__main__.py +0 -0
  26. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/config.py +0 -0
  27. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/constants.py +0 -0
  28. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/constants.py +0 -0
  29. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/fixtures.py +0 -0
  30. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_bootstrap.py +0 -0
  31. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_dev_shell_app.py +0 -0
  32. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_doctests.py +0 -0
  33. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_project_setup.py +0 -0
  34. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_readme_history.py +0 -0
  35. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/tests/test_source_file.py +0 -0
  36. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/utils/__init__.py +0 -0
  37. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/utils/colorful.py +0 -0
  38. {dev_shell-0.10.2 → dev_shell-0.11.0}/dev_shell/utils/subprocess_utils.py +0 -0
  39. {dev_shell-0.10.2 → dev_shell-0.11.0}/dist/.gitignore +0 -0
@@ -1,11 +1,4 @@
1
1
  .*
2
- *.egg-info
3
- __pycache__
4
- /dist/
5
- /build/
6
- /coverage.*
7
- *.orig
8
-
9
2
  !.github
10
3
  !.run
11
4
  !.editorconfig
@@ -13,3 +6,13 @@ __pycache__
13
6
  !.pre-commit-config.yaml
14
7
  !.pre-commit-hooks.yaml
15
8
  !.gitkeep
9
+
10
+ *.egg-info
11
+ __pycache__
12
+ /dist/
13
+ /build/
14
+ /coverage.*
15
+ *.orig
16
+
17
+ # This is a library, not an application — consumers manage their own lock file
18
+ uv.lock
@@ -2,6 +2,6 @@
2
2
  # See https://pre-commit.com for more information
3
3
  repos:
4
4
  - repo: https://github.com/jedie/cli-base-utilities
5
- rev: v0.28.0
5
+ rev: v0.30.0
6
6
  hooks:
7
7
  - id: update-readme-history
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dev-shell
3
- Version: 0.10.2
3
+ Version: 0.11.0
4
4
  Summary: Developer shell for easy startup...
5
5
  Project-URL: Documentation, https://github.com/jedie/dev-shell
6
6
  Project-URL: Source, https://github.com/jedie/dev-shell
@@ -57,14 +57,14 @@ The output looks like:
57
57
 
58
58
  [comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
59
59
  ```
60
+ Cmd2 Commands
61
+ ─────────────
62
+ alias help history macro quit set shortcuts
63
+
60
64
  dev-shell commands
61
65
  ──────────────────
62
66
  coverage install publish test version
63
67
  fix_code_style list_venv_packages pyupgrade update
64
-
65
- Uncategorized Commands
66
- ──────────────────────
67
- alias help history macro quit set shortcuts
68
68
  ```
69
69
  [comment]: <> (✂✂✂ auto generated main help end ✂✂✂)
70
70
 
@@ -88,6 +88,17 @@ See also:
88
88
 
89
89
  [comment]: <> (✂✂✂ auto generated history start ✂✂✂)
90
90
 
91
+ * [v0.11.0](https://github.com/jedie/dev-shell/compare/v0.10.2...v0.11.0)
92
+ * 2026-06-11 - Remove uv.lock from this repo: It's a library not a project
93
+ * 2026-06-11 - nox: reuse venv
94
+ * 2026-06-11 - NEW: CategorizedCommandSet replacement for @cmd2.with_default_category()
95
+ * 2026-06-11 - fix linting
96
+ * 2026-06-11 - Update requirements
97
+ * 2026-05-29 - Bump uv from 0.11.6 to 0.11.15
98
+ * 2026-04-10 - Bump uv from 0.10.4 to 0.11.6
99
+ * 2026-04-08 - Bump cryptography from 46.0.6 to 46.0.7
100
+ * 2026-03-30 - Bump pygments from 2.19.2 to 2.20.0
101
+ * 2026-03-29 - Bump cryptography from 46.0.5 to 46.0.6
91
102
  * [v0.10.2](https://github.com/jedie/dev-shell/compare/v0.10.1...v0.10.2)
92
103
  * 2026-02-19 - apply manageprojects updates
93
104
  * 2026-02-19 - Bugfix colorful helpers if a Path instance should be printed.
@@ -96,11 +107,11 @@ See also:
96
107
  * [v0.10.0](https://github.com/jedie/dev-shell/compare/v0.9.1...v0.10.0)
97
108
  * 2026-02-10 - Cleanup
98
109
  * 2026-02-09 - Update project
99
- * [v0.9.1](https://github.com/jedie/dev-shell/compare/v0.9.0...v0.9.1)
100
- * 2025-03-11 - Fix usage as package in external projects
101
110
 
102
111
  <details><summary>Expand older history entries ...</summary>
103
112
 
113
+ * [v0.9.1](https://github.com/jedie/dev-shell/compare/v0.9.0...v0.9.1)
114
+ * 2025-03-11 - Fix usage as package in external projects
104
115
  * [v0.9.0](https://github.com/jedie/dev-shell/compare/v0.8.0...v0.9.0)
105
116
  * 2025-03-11 - fix publish
106
117
  * 2025-03-11 - Replace `poetry` with `uv`
@@ -40,14 +40,14 @@ The output looks like:
40
40
 
41
41
  [comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
42
42
  ```
43
+ Cmd2 Commands
44
+ ─────────────
45
+ alias help history macro quit set shortcuts
46
+
43
47
  dev-shell commands
44
48
  ──────────────────
45
49
  coverage install publish test version
46
50
  fix_code_style list_venv_packages pyupgrade update
47
-
48
- Uncategorized Commands
49
- ──────────────────────
50
- alias help history macro quit set shortcuts
51
51
  ```
52
52
  [comment]: <> (✂✂✂ auto generated main help end ✂✂✂)
53
53
 
@@ -71,6 +71,17 @@ See also:
71
71
 
72
72
  [comment]: <> (✂✂✂ auto generated history start ✂✂✂)
73
73
 
74
+ * [v0.11.0](https://github.com/jedie/dev-shell/compare/v0.10.2...v0.11.0)
75
+ * 2026-06-11 - Remove uv.lock from this repo: It's a library not a project
76
+ * 2026-06-11 - nox: reuse venv
77
+ * 2026-06-11 - NEW: CategorizedCommandSet replacement for @cmd2.with_default_category()
78
+ * 2026-06-11 - fix linting
79
+ * 2026-06-11 - Update requirements
80
+ * 2026-05-29 - Bump uv from 0.11.6 to 0.11.15
81
+ * 2026-04-10 - Bump uv from 0.10.4 to 0.11.6
82
+ * 2026-04-08 - Bump cryptography from 46.0.6 to 46.0.7
83
+ * 2026-03-30 - Bump pygments from 2.19.2 to 2.20.0
84
+ * 2026-03-29 - Bump cryptography from 46.0.5 to 46.0.6
74
85
  * [v0.10.2](https://github.com/jedie/dev-shell/compare/v0.10.1...v0.10.2)
75
86
  * 2026-02-19 - apply manageprojects updates
76
87
  * 2026-02-19 - Bugfix colorful helpers if a Path instance should be printed.
@@ -79,11 +90,11 @@ See also:
79
90
  * [v0.10.0](https://github.com/jedie/dev-shell/compare/v0.9.1...v0.10.0)
80
91
  * 2026-02-10 - Cleanup
81
92
  * 2026-02-09 - Update project
82
- * [v0.9.1](https://github.com/jedie/dev-shell/compare/v0.9.0...v0.9.1)
83
- * 2025-03-11 - Fix usage as package in external projects
84
93
 
85
94
  <details><summary>Expand older history entries ...</summary>
86
95
 
96
+ * [v0.9.1](https://github.com/jedie/dev-shell/compare/v0.9.0...v0.9.1)
97
+ * 2025-03-11 - Fix usage as package in external projects
87
98
  * [v0.9.0](https://github.com/jedie/dev-shell/compare/v0.8.0...v0.9.0)
88
99
  * 2025-03-11 - fix publish
89
100
  * 2025-03-11 - Replace `poetry` with `uv`
@@ -4,5 +4,5 @@ Developer shell for easy startup...
4
4
  """
5
5
 
6
6
  # See https://packaging.python.org/en/latest/specifications/version-specifiers/
7
- __version__ = '0.10.2'
7
+ __version__ = '0.11.0'
8
8
  __author__ = 'Jens Diemer <dev-shell@jensdiemer.de>'
@@ -21,7 +21,7 @@ class DevShellBaseApp(cmd2.Cmd):
21
21
  delattr(cmd2.Cmd, 'do_run_pyscript')
22
22
 
23
23
  def __init__(self, *args, config: DevShellConfig, **kwargs):
24
- kwargs.update(dict(persistent_history_file='.history', allow_cli_args=False))
24
+ kwargs.update({'persistent_history_file': '.history', 'allow_cli_args': False})
25
25
  super().__init__(*args, **kwargs)
26
26
 
27
27
  self.config = config
@@ -70,9 +70,12 @@ def main(argv):
70
70
  if not uv_bin:
71
71
  print_uv_error_and_exit()
72
72
 
73
- if not Path(VIRTUAL_ENV).is_dir():
74
- verbose_check_call(uv_bin, 'venv', VIRTUAL_ENV)
73
+ first_run = not Path(VIRTUAL_ENV).is_dir()
75
74
 
75
+ # Always sync: creates venv if missing, regenerates uv.lock, installs deps:
76
+ verbose_check_call(uv_bin, 'sync')
77
+
78
+ if first_run:
76
79
  # Activate git pre-commit hooks:
77
80
  verbose_check_call(uv_bin, 'run', '--active', '-m', 'pre_commit', 'install')
78
81
 
@@ -0,0 +1,43 @@
1
+ import inspect
2
+
3
+ import cmd2
4
+ from cmd2 import CommandSet
5
+
6
+ from dev_shell.config import DevShellConfig
7
+
8
+
9
+ class CategorizedCommandSet(CommandSet):
10
+ """
11
+ A cmd2 CommandSet that automatically groups all do_* methods under a help category.
12
+
13
+ Set the class attribute `category` in a subclass to assign all its commands to that
14
+ category in the help output. The categorization happens once at class definition time
15
+ via __init_subclass__, so there is no runtime overhead per instance.
16
+
17
+ Example::
18
+
19
+ class MyCommands(CategorizedCommandSet):
20
+ category = 'My Commands'
21
+
22
+ def do_hello(self, statement):
23
+ ...
24
+ """
25
+
26
+ category = None
27
+
28
+ def __init_subclass__(cls, **kwargs):
29
+ super().__init_subclass__(**kwargs)
30
+ if category := getattr(cls, 'category', None):
31
+ cmd2.utils.categorize(
32
+ [v for k, v in inspect.getmembers(cls, predicate=inspect.isfunction) if k.startswith('do_')],
33
+ category,
34
+ )
35
+
36
+
37
+ class DevShellBaseCommandSet(CategorizedCommandSet):
38
+ category = 'dev-shell commands'
39
+
40
+ def __init__(self, config: DevShellConfig):
41
+ super().__init__()
42
+
43
+ self.config = config
@@ -23,7 +23,6 @@ except ModuleNotFoundError:
23
23
  publish_package = None
24
24
 
25
25
 
26
- @cmd2.with_default_category('dev-shell commands')
27
26
  class DevShellCommandSet(DevShellBaseCommandSet):
28
27
  """
29
28
  This command set may be used in external project, too.
@@ -27,16 +27,16 @@ def get_devshell_app_kwargs():
27
27
  config = DevShellConfig(package_module=dev_shell)
28
28
 
29
29
  # initialize all CommandSet() with context:
30
- kwargs = dict(
31
- config=config
32
- )
30
+ kwargs = {
31
+ 'config': config,
32
+ }
33
33
 
34
- app_kwargs = dict(
35
- config=config,
36
- command_sets=[
34
+ app_kwargs = {
35
+ 'config': config,
36
+ 'command_sets': [
37
37
  DevShellCommandSet(**kwargs),
38
- ]
39
- )
38
+ ],
39
+ }
40
40
  return app_kwargs
41
41
 
42
42
 
@@ -4,7 +4,7 @@ from pathlib import Path
4
4
 
5
5
  from bx_py_utils.test_utils.deny_requests import deny_any_real_request
6
6
  from cli_base.cli_tools.verbosity import MAX_LOG_LEVEL, setup_logging
7
- from rich import print # noqa
7
+ from rich import print
8
8
  from typeguard import install_import_hook
9
9
 
10
10
 
@@ -17,7 +17,7 @@ def pre_configure_tests() -> None:
17
17
 
18
18
  # Hacky way to display more "assert"-Context in failing tests:
19
19
  _MIN_MAX_DIFF = unittest.util._MAX_LENGTH - unittest.util._MIN_DIFF_LEN
20
- unittest.util._MAX_LENGTH = int(os.environ.get('UNITTEST_MAX_LENGTH', 2000))
20
+ unittest.util._MAX_LENGTH = int(os.environ.get('UNITTEST_MAX_LENGTH', '2000'))
21
21
  unittest.util._MIN_DIFF_LEN = unittest.util._MAX_LENGTH - _MIN_MAX_DIFF
22
22
 
23
23
  # Deny any request via docket/urllib3 because tests they should mock all requests:
@@ -7,13 +7,21 @@ from manageprojects.tests.base import BaseTestCase
7
7
  from dev_shell.constants import DEV_SHELL_PKG_PATH
8
8
 
9
9
 
10
+ def remove_until_usage(text: str) -> str:
11
+ lines = text.splitlines()
12
+ for idx, line in enumerate(lines):
13
+ if '-m dev_shell help' in line:
14
+ return '\n'.join(lines[idx + 1 :])
15
+ raise ValueError('No usage line found')
16
+
17
+
10
18
  def assert_cli_help_in_readme(text_block: str, marker: str):
11
19
  README_PATH = DEV_SHELL_PKG_PATH.parent / 'README.md'
12
20
  assert_is_file(README_PATH)
13
21
 
14
- text_block = '\n'.join(text_block.splitlines()[2:])
15
-
22
+ text_block = remove_until_usage(text_block)
16
23
  text_block = f'```\n{text_block.strip()}\n```'
24
+
17
25
  assert_readme_block(
18
26
  readme_path=README_PATH,
19
27
  text_block=text_block,
@@ -70,9 +70,12 @@ def main(argv):
70
70
  if not uv_bin:
71
71
  print_uv_error_and_exit()
72
72
 
73
- if not Path(VIRTUAL_ENV).is_dir():
74
- verbose_check_call(uv_bin, 'venv', VIRTUAL_ENV)
73
+ first_run = not Path(VIRTUAL_ENV).is_dir()
75
74
 
75
+ # Always sync: creates venv if missing, regenerates uv.lock, installs deps:
76
+ verbose_check_call(uv_bin, 'sync')
77
+
78
+ if first_run:
76
79
  # Activate git pre-commit hooks:
77
80
  verbose_check_call(uv_bin, 'run', '--active', '-m', 'pre_commit', 'install')
78
81
 
@@ -12,6 +12,7 @@ PYTHON_VERSIONS = ('3.14', '3.13', '3.12')
12
12
  @nox.session(
13
13
  python=PYTHON_VERSIONS,
14
14
  venv_backend='uv',
15
+ reuse_venv=True,
15
16
  download_python='auto',
16
17
  )
17
18
  def tests(session: Session):
@@ -67,6 +67,7 @@ version_module_name = "dev_shell" # Used by "update-readme-history" git hook
67
67
  line-length = 120
68
68
  exclude = [
69
69
  ".*/",
70
+ "dev_shell/bootstrap-source.py",
70
71
  ]
71
72
 
72
73
  [tool.ruff.lint]
@@ -1,10 +0,0 @@
1
- from cmd2 import CommandSet
2
-
3
- from dev_shell.config import DevShellConfig
4
-
5
-
6
- class DevShellBaseCommandSet(CommandSet):
7
- def __init__(self, config: DevShellConfig):
8
- super().__init__()
9
-
10
- self.config = config