dev-shell 0.10.0__tar.gz → 0.10.2__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.
- dev_shell-0.10.2/.pre-commit-config.yaml +7 -0
- dev_shell-0.10.2/.pre-commit-hooks.yaml +13 -0
- dev_shell-0.10.2/PKG-INFO +220 -0
- dev_shell-0.10.2/README.md +203 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/__init__.py +1 -1
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/bootstrap-source.py +7 -1
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/command_sets/dev_shell_commands.py +4 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/dev_shell_app.py +9 -1
- dev_shell-0.10.2/dev_shell/tests/test_readme.py +39 -0
- dev_shell-0.10.2/dev_shell/tests/test_readme_history.py +9 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/utils/colorful.py +22 -15
- {dev_shell-0.10.0 → dev_shell-0.10.2}/devshell.py +7 -1
- {dev_shell-0.10.0 → dev_shell-0.10.2}/pyproject.toml +3 -1
- {dev_shell-0.10.0 → dev_shell-0.10.2}/uv.lock +242 -186
- dev_shell-0.10.0/PKG-INFO +0 -152
- dev_shell-0.10.0/README.md +0 -135
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.editorconfig +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.github/workflows/tests.yml +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.gitignore +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.idea/.gitignore +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.run/Template Python tests.run.xml +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/.run/Unittests __all__.run.xml +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/LICENSE +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/__main__.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/base_cmd2_app.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/command_sets/__init__.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/config.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/constants.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/__init__.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/constants.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/fixtures.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/test_bootstrap.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/test_dev_shell_app.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/test_doctests.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/test_project_setup.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/tests/test_source_file.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/utils/__init__.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dev_shell/utils/subprocess_utils.py +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/dist/.gitignore +0 -0
- {dev_shell-0.10.0 → dev_shell-0.10.2}/noxfile.py +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# https://pre-commit.com/#creating-new-hooks
|
|
2
|
+
- id: update-readme-history
|
|
3
|
+
name: cli-base-utilities
|
|
4
|
+
description: >-
|
|
5
|
+
Update history in README.md from git log.
|
|
6
|
+
entry: "python -m cli_base update-readme-history -v"
|
|
7
|
+
language: python
|
|
8
|
+
language_version: python3
|
|
9
|
+
require_serial: true
|
|
10
|
+
pass_filenames: false
|
|
11
|
+
always_run: true
|
|
12
|
+
verbose: true
|
|
13
|
+
stages: [pre-commit, post-rewrite, pre-push]
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dev-shell
|
|
3
|
+
Version: 0.10.2
|
|
4
|
+
Summary: Developer shell for easy startup...
|
|
5
|
+
Project-URL: Documentation, https://github.com/jedie/dev-shell
|
|
6
|
+
Project-URL: Source, https://github.com/jedie/dev-shell
|
|
7
|
+
Author-email: Jens Diemer <dev-shell@jensdiemer.de>
|
|
8
|
+
License: GPL-3.0-or-later
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Requires-Dist: cli-base-utilities>=0.28.0
|
|
12
|
+
Requires-Dist: cmd2
|
|
13
|
+
Requires-Dist: gnureadline; sys_platform != 'win32'
|
|
14
|
+
Requires-Dist: pyreadline3; sys_platform == 'win32'
|
|
15
|
+
Requires-Dist: rich
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# A "dev-shell" for Python projects ;)
|
|
19
|
+
|
|
20
|
+
**Note: The continuation of this project is uncertain!**
|
|
21
|
+
|
|
22
|
+
[](https://github.com/jedie/dev-shell/actions/workflows/tests.yml)
|
|
23
|
+
[](https://app.codecov.io/github/jedie/dev_shell)
|
|
24
|
+
[](https://pypi.org/project/dev_shell/)
|
|
25
|
+
[](https://github.com/jedie/dev-shell/blob/main/pyproject.toml)
|
|
26
|
+
[](https://github.com/jedie/dev-shell/blob/main/LICENSE)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
This small project is intended to improve the start-up for collaborators.
|
|
30
|
+
|
|
31
|
+
The idea is to make the project setup as simple as possible. Just clone the sources and start a script and you're done ;)
|
|
32
|
+
|
|
33
|
+
Why in hell not just a `Makefile`? Because it doesn't out-of-the-box under Windows and MacOS, the dev-shell does ;)
|
|
34
|
+
|
|
35
|
+
Run Tests? Just start the script and call the "run test command".
|
|
36
|
+
|
|
37
|
+
The "dev-shell" is the base to create a CLI and a shell. It also shows how to make a project bootstrap as simply as possible, e.g.:
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
At least `uv` is needed. Install e.g.: via pipx:
|
|
41
|
+
```bash
|
|
42
|
+
apt-get install pipx
|
|
43
|
+
pipx install uv
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Clone the project and just start the CLI help commands.
|
|
47
|
+
A virtual environment will be created/updated automatically.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
~$ git clone https://github.com/jedie/dev-shell.git
|
|
51
|
+
~$ cd dev-shell
|
|
52
|
+
~/dev-shell$ devshell.py --help
|
|
53
|
+
~/dev-shell$ devshell.py test
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The output looks like:
|
|
57
|
+
|
|
58
|
+
[comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
|
|
59
|
+
```
|
|
60
|
+
dev-shell commands
|
|
61
|
+
──────────────────
|
|
62
|
+
coverage install publish test version
|
|
63
|
+
fix_code_style list_venv_packages pyupgrade update
|
|
64
|
+
|
|
65
|
+
Uncategorized Commands
|
|
66
|
+
──────────────────────
|
|
67
|
+
alias help history macro quit set shortcuts
|
|
68
|
+
```
|
|
69
|
+
[comment]: <> (✂✂✂ auto generated main help end ✂✂✂)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## compatibility
|
|
75
|
+
|
|
76
|
+
| dev-shell version | OS | Python version |
|
|
77
|
+
|-------------------|-------------------------|---------------------|
|
|
78
|
+
| >=v0.10.0 | Linux + MacOS + Windows | 3.14, 3.13, 3.12 |
|
|
79
|
+
| >=v0.7.0 | Linux + MacOS + Windows | 3.11, 3.10, 3.9 |
|
|
80
|
+
| >=v0.5.0 | Linux + MacOS + Windows | 3.10, 3.9, 3.8, 3.7 |
|
|
81
|
+
| >=v0.0.1 | Linux + MacOS + Windows | 3.9, 3.8, 3.7 |
|
|
82
|
+
|
|
83
|
+
See also:
|
|
84
|
+
* github test configuration: [.github/workflows/test.yml](https://github.com/jedie/dev-shell/blob/main/.github/workflows/test.yml)
|
|
85
|
+
* Nox configuration: [noxfile.py](https://github.com/jedie/dev-shell/blob/main/noxfile.py)
|
|
86
|
+
|
|
87
|
+
## History
|
|
88
|
+
|
|
89
|
+
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
|
|
90
|
+
|
|
91
|
+
* [v0.10.2](https://github.com/jedie/dev-shell/compare/v0.10.1...v0.10.2)
|
|
92
|
+
* 2026-02-19 - apply manageprojects updates
|
|
93
|
+
* 2026-02-19 - Bugfix colorful helpers if a Path instance should be printed.
|
|
94
|
+
* [v0.10.1](https://github.com/jedie/dev-shell/compare/v0.10.0...v0.10.1)
|
|
95
|
+
* 2026-02-10 - Bugfix text color styles
|
|
96
|
+
* [v0.10.0](https://github.com/jedie/dev-shell/compare/v0.9.1...v0.10.0)
|
|
97
|
+
* 2026-02-10 - Cleanup
|
|
98
|
+
* 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
|
+
|
|
102
|
+
<details><summary>Expand older history entries ...</summary>
|
|
103
|
+
|
|
104
|
+
* [v0.9.0](https://github.com/jedie/dev-shell/compare/v0.8.0...v0.9.0)
|
|
105
|
+
* 2025-03-11 - fix publish
|
|
106
|
+
* 2025-03-11 - Replace `poetry` with `uv`
|
|
107
|
+
* [v0.8.0](https://github.com/jedie/dev-shell/compare/v0.7.0...v0.8.0)
|
|
108
|
+
* 2024-04-09 - Bump version to v0.8.0
|
|
109
|
+
* 2024-04-09 - Remove "gnureadline" as dependency and update boot script
|
|
110
|
+
* 2024-04-09 - Remove "gnureadline" as dependency
|
|
111
|
+
* 2023-07-09 - Update requirements
|
|
112
|
+
* [v0.7.0](https://github.com/jedie/dev-shell/compare/v0.6.1...v0.7.0)
|
|
113
|
+
* 2023-04-25 - Bugfix RedirectStdOutErr
|
|
114
|
+
* 2023-04-25 - Update test matrix
|
|
115
|
+
* 2023-04-25 - Update requirements
|
|
116
|
+
* 2022-09-19 - skip linting (we use darker)
|
|
117
|
+
* 2022-09-19 - CI: cache packages
|
|
118
|
+
* [v0.6.1](https://github.com/jedie/dev-shell/compare/v0.6.0...v0.6.1)
|
|
119
|
+
* 2022-09-02 - Update README.md
|
|
120
|
+
* 2022-09-02 - v0.6.1 - update tests adn README
|
|
121
|
+
* 2022-09-02 - remove "pytest-flake8" and "pytest-isort"
|
|
122
|
+
* 2022-09-02 - update requirements
|
|
123
|
+
* 2022-09-02 - Call "poetry update" with "-v"
|
|
124
|
+
* 2022-09-02 - skip Poetry v1.2.0
|
|
125
|
+
* 2022-09-02 - Set default timeout to 5Min.
|
|
126
|
+
* [v0.6.0](https://github.com/jedie/dev-shell/compare/v0.5.0...v0.6.0)
|
|
127
|
+
* 2022-07-19 - updates
|
|
128
|
+
* 2022-07-19 - dd "pyupgrade" as shell command
|
|
129
|
+
* 2022-07-19 - Update README.md
|
|
130
|
+
* 2022-07-19 - Update requirements
|
|
131
|
+
* [v0.5.0](https://github.com/jedie/dev-shell/compare/v0.4.0...v0.5.0)
|
|
132
|
+
* 2022-05-29 - update flake8 config
|
|
133
|
+
* 2022-05-29 - simplify isort config
|
|
134
|
+
* 2022-05-29 - fix isort checks
|
|
135
|
+
* 2022-05-29 - v0.5.0.rc1
|
|
136
|
+
* 2022-05-29 - update tox settings
|
|
137
|
+
* 2022-05-29 - line_length = 100
|
|
138
|
+
* 2022-05-29 - call github tests via tox
|
|
139
|
+
* 2022-05-29 - Add "tox" and "poetry" commands
|
|
140
|
+
* 2022-05-29 - Test also with Python 3.10
|
|
141
|
+
* 2022-05-29 - Update requirements
|
|
142
|
+
* [v0.4.0](https://github.com/jedie/dev-shell/compare/v0.3.0...v0.4.0)
|
|
143
|
+
* 2022-02-28 - Release v0.4.0
|
|
144
|
+
* 2022-02-28 - Update requirements
|
|
145
|
+
* [v0.3.0](https://github.com/jedie/dev-shell/compare/v0.2.4...v0.3.0)
|
|
146
|
+
* 2022-01-30 - Remove "flynt" form linting/fix code style
|
|
147
|
+
* [v0.2.4](https://github.com/jedie/dev-shell/compare/v0.2.3...v0.2.4)
|
|
148
|
+
* 2022-01-22 - Switch to darker and use pytest-darker
|
|
149
|
+
* 2022-01-22 - update requirements
|
|
150
|
+
* [v0.2.3](https://github.com/jedie/dev-shell/compare/v0.2.2...v0.2.3)
|
|
151
|
+
* 2021-11-15 - Fix #29 - Flynt args can be change via CommandSet
|
|
152
|
+
* 2021-11-15 - update requirements
|
|
153
|
+
* 2021-11-15 - Update test.yml
|
|
154
|
+
* [v0.2.2](https://github.com/jedie/dev-shell/compare/v0.2.1...v0.2.2)
|
|
155
|
+
* 2021-04-12 - include source "bootstrap" file
|
|
156
|
+
* [v0.2.1](https://github.com/jedie/dev-shell/compare/v0.2.0...v0.2.1)
|
|
157
|
+
* 2021-04-12 - Handle if "poetry-publish" is not installed
|
|
158
|
+
* [v0.2.0](https://github.com/jedie/dev-shell/compare/v0.1.0...v0.2.0)
|
|
159
|
+
* 2021-04-11 - Fix flake8 call: Remove arguments and add .flake8 config file
|
|
160
|
+
* 2021-04-11 - Update dependencies + add "update" command
|
|
161
|
+
* 2021-04-11 - Release 0.2.0rc1
|
|
162
|
+
* 2021-04-11 - Fix #24 test under windows
|
|
163
|
+
* 2021-04-10 - The DocTest will not work on Windows. Replace it with a normal test ;)
|
|
164
|
+
* 2021-04-10 - Bugfix error on Windows: File "C:\Users\sysop\PycharmProjects\dev-shell\dev_shell\utils\subprocess_utils.py", line 125, in prepare_popenargs command = shutil.which(command_path, path=bin_path) File "C:\Users\sysop\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 1441, in which if any(cmd.lower().endswith(ext.lower()) for ext in pathext): File "C:\Users\sysop\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 1441, in <genexpr> if any(cmd.lower().endswith(ext.lower()) for ext in pathext): AttributeError: 'WindowsPath' object has no attribute 'lower' EXCEPTION of type 'AttributeError' occurred with message: ''WindowsPath' object has no attribute 'lower''
|
|
165
|
+
* 2021-04-10 - Replace "SubprocessMock" with a simple function
|
|
166
|
+
* 2021-04-10 - Bugfix calls outside the project directory...
|
|
167
|
+
* 2021-04-10 - Do linting via tests
|
|
168
|
+
* 2021-04-10 - Update also "setuptools", too.
|
|
169
|
+
* 2021-04-05 - fix tests
|
|
170
|
+
* 2021-04-05 - code style
|
|
171
|
+
* 2021-04-05 - recognize "--update" and "--help" calls better
|
|
172
|
+
* 2021-04-05 - remove "max-parallel"
|
|
173
|
+
* 2021-03-26 - Rename: "dev-shell.py => devshell.py" and add tests for it
|
|
174
|
+
* 2021-03-26 - Auto update .venv if poetry.lock changed
|
|
175
|
+
* 2021-03-22 - Update README.md
|
|
176
|
+
* 2021-03-22 - Remove "path" argument from flynt and autopep8
|
|
177
|
+
* [v0.1.0](https://github.com/jedie/dev-shell/compare/v0.0.2...v0.1.0)
|
|
178
|
+
* 2021-03-22 - release v0.1.0
|
|
179
|
+
* 2021-03-22 - Better "run as CLI" implementation
|
|
180
|
+
* 2021-03-22 - Update README.md
|
|
181
|
+
* 2021-03-19 - Bugfix handle of sys.exit() and return code (Imporant for CI usage)
|
|
182
|
+
* 2021-03-22 - Update test.yml
|
|
183
|
+
* 2021-03-20 - +!.github
|
|
184
|
+
* 2021-03-20 - Update dev-shell.py
|
|
185
|
+
* 2021-03-20 - add gitignore
|
|
186
|
+
* 2021-03-19 - Bugfix subprocess call: Don't feed shutil.which() with Path() instance
|
|
187
|
+
* [v0.0.2](https://github.com/jedie/dev-shell/compare/v0.0.1...v0.0.2)
|
|
188
|
+
* 2021-03-19 - refactor colorful
|
|
189
|
+
* [v0.0.1](https://github.com/jedie/dev-shell/compare/ad5dca7...v0.0.1)
|
|
190
|
+
* 2021-03-19 - activate codecov.io
|
|
191
|
+
* 2021-03-19 - Run linters on github actions
|
|
192
|
+
* 2021-03-19 - Bugfix linting
|
|
193
|
+
* 2021-03-19 - bump to version v0.0.1
|
|
194
|
+
* 2021-03-19 - refactor and add linting and "fix_code_style" commands
|
|
195
|
+
* 2021-03-19 - fix code style
|
|
196
|
+
* 2021-03-19 - subprocess utils: Search for command in PATH
|
|
197
|
+
* 2021-03-19 - update requirements
|
|
198
|
+
* 2021-03-19 - Create a generic CmdAppBaseTestCase
|
|
199
|
+
* 2021-03-19 - code cleanup
|
|
200
|
+
* 2021-03-19 - Update README.md
|
|
201
|
+
* 2021-03-19 - Bugfix Python 3.7 subprocess calls with Path() instances
|
|
202
|
+
* 2021-03-19 - Bugfixes for windows
|
|
203
|
+
* 2021-03-19 - Test on macos, too - TODO: Add windows support
|
|
204
|
+
* 2021-03-19 - Update README
|
|
205
|
+
* 2021-03-18 - add readme
|
|
206
|
+
* 2021-03-18 - bugfix github action
|
|
207
|
+
* 2021-03-18 - Activate github actions
|
|
208
|
+
* 2021-03-18 - make it alive
|
|
209
|
+
* 2021-03-18 - init
|
|
210
|
+
* 2021-03-18 - Initial commit
|
|
211
|
+
|
|
212
|
+
</details>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
[comment]: <> (✂✂✂ auto generated history end ✂✂✂)
|
|
216
|
+
|
|
217
|
+
## Project links
|
|
218
|
+
|
|
219
|
+
* Github: https://github.com/jedie/dev-shell/
|
|
220
|
+
* PyPi: https://pypi.org/project/dev-shell/
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# A "dev-shell" for Python projects ;)
|
|
2
|
+
|
|
3
|
+
**Note: The continuation of this project is uncertain!**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/jedie/dev-shell/actions/workflows/tests.yml)
|
|
6
|
+
[](https://app.codecov.io/github/jedie/dev_shell)
|
|
7
|
+
[](https://pypi.org/project/dev_shell/)
|
|
8
|
+
[](https://github.com/jedie/dev-shell/blob/main/pyproject.toml)
|
|
9
|
+
[](https://github.com/jedie/dev-shell/blob/main/LICENSE)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
This small project is intended to improve the start-up for collaborators.
|
|
13
|
+
|
|
14
|
+
The idea is to make the project setup as simple as possible. Just clone the sources and start a script and you're done ;)
|
|
15
|
+
|
|
16
|
+
Why in hell not just a `Makefile`? Because it doesn't out-of-the-box under Windows and MacOS, the dev-shell does ;)
|
|
17
|
+
|
|
18
|
+
Run Tests? Just start the script and call the "run test command".
|
|
19
|
+
|
|
20
|
+
The "dev-shell" is the base to create a CLI and a shell. It also shows how to make a project bootstrap as simply as possible, e.g.:
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
At least `uv` is needed. Install e.g.: via pipx:
|
|
24
|
+
```bash
|
|
25
|
+
apt-get install pipx
|
|
26
|
+
pipx install uv
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Clone the project and just start the CLI help commands.
|
|
30
|
+
A virtual environment will be created/updated automatically.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
~$ git clone https://github.com/jedie/dev-shell.git
|
|
34
|
+
~$ cd dev-shell
|
|
35
|
+
~/dev-shell$ devshell.py --help
|
|
36
|
+
~/dev-shell$ devshell.py test
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The output looks like:
|
|
40
|
+
|
|
41
|
+
[comment]: <> (✂✂✂ auto generated main help start ✂✂✂)
|
|
42
|
+
```
|
|
43
|
+
dev-shell commands
|
|
44
|
+
──────────────────
|
|
45
|
+
coverage install publish test version
|
|
46
|
+
fix_code_style list_venv_packages pyupgrade update
|
|
47
|
+
|
|
48
|
+
Uncategorized Commands
|
|
49
|
+
──────────────────────
|
|
50
|
+
alias help history macro quit set shortcuts
|
|
51
|
+
```
|
|
52
|
+
[comment]: <> (✂✂✂ auto generated main help end ✂✂✂)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## compatibility
|
|
58
|
+
|
|
59
|
+
| dev-shell version | OS | Python version |
|
|
60
|
+
|-------------------|-------------------------|---------------------|
|
|
61
|
+
| >=v0.10.0 | Linux + MacOS + Windows | 3.14, 3.13, 3.12 |
|
|
62
|
+
| >=v0.7.0 | Linux + MacOS + Windows | 3.11, 3.10, 3.9 |
|
|
63
|
+
| >=v0.5.0 | Linux + MacOS + Windows | 3.10, 3.9, 3.8, 3.7 |
|
|
64
|
+
| >=v0.0.1 | Linux + MacOS + Windows | 3.9, 3.8, 3.7 |
|
|
65
|
+
|
|
66
|
+
See also:
|
|
67
|
+
* github test configuration: [.github/workflows/test.yml](https://github.com/jedie/dev-shell/blob/main/.github/workflows/test.yml)
|
|
68
|
+
* Nox configuration: [noxfile.py](https://github.com/jedie/dev-shell/blob/main/noxfile.py)
|
|
69
|
+
|
|
70
|
+
## History
|
|
71
|
+
|
|
72
|
+
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
|
|
73
|
+
|
|
74
|
+
* [v0.10.2](https://github.com/jedie/dev-shell/compare/v0.10.1...v0.10.2)
|
|
75
|
+
* 2026-02-19 - apply manageprojects updates
|
|
76
|
+
* 2026-02-19 - Bugfix colorful helpers if a Path instance should be printed.
|
|
77
|
+
* [v0.10.1](https://github.com/jedie/dev-shell/compare/v0.10.0...v0.10.1)
|
|
78
|
+
* 2026-02-10 - Bugfix text color styles
|
|
79
|
+
* [v0.10.0](https://github.com/jedie/dev-shell/compare/v0.9.1...v0.10.0)
|
|
80
|
+
* 2026-02-10 - Cleanup
|
|
81
|
+
* 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
|
+
|
|
85
|
+
<details><summary>Expand older history entries ...</summary>
|
|
86
|
+
|
|
87
|
+
* [v0.9.0](https://github.com/jedie/dev-shell/compare/v0.8.0...v0.9.0)
|
|
88
|
+
* 2025-03-11 - fix publish
|
|
89
|
+
* 2025-03-11 - Replace `poetry` with `uv`
|
|
90
|
+
* [v0.8.0](https://github.com/jedie/dev-shell/compare/v0.7.0...v0.8.0)
|
|
91
|
+
* 2024-04-09 - Bump version to v0.8.0
|
|
92
|
+
* 2024-04-09 - Remove "gnureadline" as dependency and update boot script
|
|
93
|
+
* 2024-04-09 - Remove "gnureadline" as dependency
|
|
94
|
+
* 2023-07-09 - Update requirements
|
|
95
|
+
* [v0.7.0](https://github.com/jedie/dev-shell/compare/v0.6.1...v0.7.0)
|
|
96
|
+
* 2023-04-25 - Bugfix RedirectStdOutErr
|
|
97
|
+
* 2023-04-25 - Update test matrix
|
|
98
|
+
* 2023-04-25 - Update requirements
|
|
99
|
+
* 2022-09-19 - skip linting (we use darker)
|
|
100
|
+
* 2022-09-19 - CI: cache packages
|
|
101
|
+
* [v0.6.1](https://github.com/jedie/dev-shell/compare/v0.6.0...v0.6.1)
|
|
102
|
+
* 2022-09-02 - Update README.md
|
|
103
|
+
* 2022-09-02 - v0.6.1 - update tests adn README
|
|
104
|
+
* 2022-09-02 - remove "pytest-flake8" and "pytest-isort"
|
|
105
|
+
* 2022-09-02 - update requirements
|
|
106
|
+
* 2022-09-02 - Call "poetry update" with "-v"
|
|
107
|
+
* 2022-09-02 - skip Poetry v1.2.0
|
|
108
|
+
* 2022-09-02 - Set default timeout to 5Min.
|
|
109
|
+
* [v0.6.0](https://github.com/jedie/dev-shell/compare/v0.5.0...v0.6.0)
|
|
110
|
+
* 2022-07-19 - updates
|
|
111
|
+
* 2022-07-19 - dd "pyupgrade" as shell command
|
|
112
|
+
* 2022-07-19 - Update README.md
|
|
113
|
+
* 2022-07-19 - Update requirements
|
|
114
|
+
* [v0.5.0](https://github.com/jedie/dev-shell/compare/v0.4.0...v0.5.0)
|
|
115
|
+
* 2022-05-29 - update flake8 config
|
|
116
|
+
* 2022-05-29 - simplify isort config
|
|
117
|
+
* 2022-05-29 - fix isort checks
|
|
118
|
+
* 2022-05-29 - v0.5.0.rc1
|
|
119
|
+
* 2022-05-29 - update tox settings
|
|
120
|
+
* 2022-05-29 - line_length = 100
|
|
121
|
+
* 2022-05-29 - call github tests via tox
|
|
122
|
+
* 2022-05-29 - Add "tox" and "poetry" commands
|
|
123
|
+
* 2022-05-29 - Test also with Python 3.10
|
|
124
|
+
* 2022-05-29 - Update requirements
|
|
125
|
+
* [v0.4.0](https://github.com/jedie/dev-shell/compare/v0.3.0...v0.4.0)
|
|
126
|
+
* 2022-02-28 - Release v0.4.0
|
|
127
|
+
* 2022-02-28 - Update requirements
|
|
128
|
+
* [v0.3.0](https://github.com/jedie/dev-shell/compare/v0.2.4...v0.3.0)
|
|
129
|
+
* 2022-01-30 - Remove "flynt" form linting/fix code style
|
|
130
|
+
* [v0.2.4](https://github.com/jedie/dev-shell/compare/v0.2.3...v0.2.4)
|
|
131
|
+
* 2022-01-22 - Switch to darker and use pytest-darker
|
|
132
|
+
* 2022-01-22 - update requirements
|
|
133
|
+
* [v0.2.3](https://github.com/jedie/dev-shell/compare/v0.2.2...v0.2.3)
|
|
134
|
+
* 2021-11-15 - Fix #29 - Flynt args can be change via CommandSet
|
|
135
|
+
* 2021-11-15 - update requirements
|
|
136
|
+
* 2021-11-15 - Update test.yml
|
|
137
|
+
* [v0.2.2](https://github.com/jedie/dev-shell/compare/v0.2.1...v0.2.2)
|
|
138
|
+
* 2021-04-12 - include source "bootstrap" file
|
|
139
|
+
* [v0.2.1](https://github.com/jedie/dev-shell/compare/v0.2.0...v0.2.1)
|
|
140
|
+
* 2021-04-12 - Handle if "poetry-publish" is not installed
|
|
141
|
+
* [v0.2.0](https://github.com/jedie/dev-shell/compare/v0.1.0...v0.2.0)
|
|
142
|
+
* 2021-04-11 - Fix flake8 call: Remove arguments and add .flake8 config file
|
|
143
|
+
* 2021-04-11 - Update dependencies + add "update" command
|
|
144
|
+
* 2021-04-11 - Release 0.2.0rc1
|
|
145
|
+
* 2021-04-11 - Fix #24 test under windows
|
|
146
|
+
* 2021-04-10 - The DocTest will not work on Windows. Replace it with a normal test ;)
|
|
147
|
+
* 2021-04-10 - Bugfix error on Windows: File "C:\Users\sysop\PycharmProjects\dev-shell\dev_shell\utils\subprocess_utils.py", line 125, in prepare_popenargs command = shutil.which(command_path, path=bin_path) File "C:\Users\sysop\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 1441, in which if any(cmd.lower().endswith(ext.lower()) for ext in pathext): File "C:\Users\sysop\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 1441, in <genexpr> if any(cmd.lower().endswith(ext.lower()) for ext in pathext): AttributeError: 'WindowsPath' object has no attribute 'lower' EXCEPTION of type 'AttributeError' occurred with message: ''WindowsPath' object has no attribute 'lower''
|
|
148
|
+
* 2021-04-10 - Replace "SubprocessMock" with a simple function
|
|
149
|
+
* 2021-04-10 - Bugfix calls outside the project directory...
|
|
150
|
+
* 2021-04-10 - Do linting via tests
|
|
151
|
+
* 2021-04-10 - Update also "setuptools", too.
|
|
152
|
+
* 2021-04-05 - fix tests
|
|
153
|
+
* 2021-04-05 - code style
|
|
154
|
+
* 2021-04-05 - recognize "--update" and "--help" calls better
|
|
155
|
+
* 2021-04-05 - remove "max-parallel"
|
|
156
|
+
* 2021-03-26 - Rename: "dev-shell.py => devshell.py" and add tests for it
|
|
157
|
+
* 2021-03-26 - Auto update .venv if poetry.lock changed
|
|
158
|
+
* 2021-03-22 - Update README.md
|
|
159
|
+
* 2021-03-22 - Remove "path" argument from flynt and autopep8
|
|
160
|
+
* [v0.1.0](https://github.com/jedie/dev-shell/compare/v0.0.2...v0.1.0)
|
|
161
|
+
* 2021-03-22 - release v0.1.0
|
|
162
|
+
* 2021-03-22 - Better "run as CLI" implementation
|
|
163
|
+
* 2021-03-22 - Update README.md
|
|
164
|
+
* 2021-03-19 - Bugfix handle of sys.exit() and return code (Imporant for CI usage)
|
|
165
|
+
* 2021-03-22 - Update test.yml
|
|
166
|
+
* 2021-03-20 - +!.github
|
|
167
|
+
* 2021-03-20 - Update dev-shell.py
|
|
168
|
+
* 2021-03-20 - add gitignore
|
|
169
|
+
* 2021-03-19 - Bugfix subprocess call: Don't feed shutil.which() with Path() instance
|
|
170
|
+
* [v0.0.2](https://github.com/jedie/dev-shell/compare/v0.0.1...v0.0.2)
|
|
171
|
+
* 2021-03-19 - refactor colorful
|
|
172
|
+
* [v0.0.1](https://github.com/jedie/dev-shell/compare/ad5dca7...v0.0.1)
|
|
173
|
+
* 2021-03-19 - activate codecov.io
|
|
174
|
+
* 2021-03-19 - Run linters on github actions
|
|
175
|
+
* 2021-03-19 - Bugfix linting
|
|
176
|
+
* 2021-03-19 - bump to version v0.0.1
|
|
177
|
+
* 2021-03-19 - refactor and add linting and "fix_code_style" commands
|
|
178
|
+
* 2021-03-19 - fix code style
|
|
179
|
+
* 2021-03-19 - subprocess utils: Search for command in PATH
|
|
180
|
+
* 2021-03-19 - update requirements
|
|
181
|
+
* 2021-03-19 - Create a generic CmdAppBaseTestCase
|
|
182
|
+
* 2021-03-19 - code cleanup
|
|
183
|
+
* 2021-03-19 - Update README.md
|
|
184
|
+
* 2021-03-19 - Bugfix Python 3.7 subprocess calls with Path() instances
|
|
185
|
+
* 2021-03-19 - Bugfixes for windows
|
|
186
|
+
* 2021-03-19 - Test on macos, too - TODO: Add windows support
|
|
187
|
+
* 2021-03-19 - Update README
|
|
188
|
+
* 2021-03-18 - add readme
|
|
189
|
+
* 2021-03-18 - bugfix github action
|
|
190
|
+
* 2021-03-18 - Activate github actions
|
|
191
|
+
* 2021-03-18 - make it alive
|
|
192
|
+
* 2021-03-18 - init
|
|
193
|
+
* 2021-03-18 - Initial commit
|
|
194
|
+
|
|
195
|
+
</details>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
[comment]: <> (✂✂✂ auto generated history end ✂✂✂)
|
|
199
|
+
|
|
200
|
+
## Project links
|
|
201
|
+
|
|
202
|
+
* Github: https://github.com/jedie/dev-shell/
|
|
203
|
+
* PyPi: https://pypi.org/project/dev-shell/
|
|
@@ -70,12 +70,18 @@ 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)
|
|
75
|
+
|
|
76
|
+
# Activate git pre-commit hooks:
|
|
77
|
+
verbose_check_call(uv_bin, 'run', '--active', '-m', 'pre_commit', 'install')
|
|
78
|
+
|
|
73
79
|
# The cmd2 shell should not abort on Ctrl-C => ignore "Interrupt from keyboard" signal:
|
|
74
80
|
signal.signal(signal.SIGINT, noop_signal_handler)
|
|
75
81
|
|
|
76
82
|
# Call our entry point CLI:
|
|
77
83
|
try:
|
|
78
|
-
verbose_check_call(uv_bin, 'run', '-m', 'dev_shell', *argv[1:])
|
|
84
|
+
verbose_check_call(uv_bin, 'run', '--active', '-m', 'dev_shell', *argv[1:])
|
|
79
85
|
except subprocess.CalledProcessError as err:
|
|
80
86
|
sys.exit(err.returncode)
|
|
81
87
|
|
|
@@ -99,6 +99,10 @@ class DevShellCommandSet(DevShellBaseCommandSet):
|
|
|
99
99
|
# Install new dependencies in current .venv:
|
|
100
100
|
tools_executor.verbose_check_call('uv', 'sync')
|
|
101
101
|
|
|
102
|
+
if tools_executor.is_executable('pre-commit'):
|
|
103
|
+
# Update git pre-commit hooks:
|
|
104
|
+
tools_executor.verbose_check_call('pre-commit', 'autoupdate')
|
|
105
|
+
|
|
102
106
|
print(bright_green('\n\nPlease restart the shell !\n'))
|
|
103
107
|
sys.exit(0) # Stop cmd
|
|
104
108
|
|
|
@@ -8,7 +8,15 @@ class DevShellApp(DevShellBaseApp):
|
|
|
8
8
|
"""
|
|
9
9
|
The "dev-shell" Cmd2 App
|
|
10
10
|
"""
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
def __init__(self, *args, **kwargs):
|
|
13
|
+
super().__init__(*args, **kwargs)
|
|
14
|
+
|
|
15
|
+
# Just print the help table on startup if no CLI usage (no command passed as argument):
|
|
16
|
+
if not self._startup_commands:
|
|
17
|
+
self._startup_commands = [
|
|
18
|
+
'help',
|
|
19
|
+
]
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
def get_devshell_app_kwargs():
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from bx_py_utils.auto_doc import assert_readme_block
|
|
2
|
+
from bx_py_utils.path import assert_is_file
|
|
3
|
+
from cli_base.cli_tools.test_utils.assertion import assert_in
|
|
4
|
+
from cli_base.cli_tools.test_utils.rich_test_utils import NoColorEnvRich, invoke
|
|
5
|
+
from manageprojects.tests.base import BaseTestCase
|
|
6
|
+
|
|
7
|
+
from dev_shell.constants import DEV_SHELL_PKG_PATH
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def assert_cli_help_in_readme(text_block: str, marker: str):
|
|
11
|
+
README_PATH = DEV_SHELL_PKG_PATH.parent / 'README.md'
|
|
12
|
+
assert_is_file(README_PATH)
|
|
13
|
+
|
|
14
|
+
text_block = '\n'.join(text_block.splitlines()[2:])
|
|
15
|
+
|
|
16
|
+
text_block = f'```\n{text_block.strip()}\n```'
|
|
17
|
+
assert_readme_block(
|
|
18
|
+
readme_path=README_PATH,
|
|
19
|
+
text_block=text_block,
|
|
20
|
+
start_marker_line=f'[comment]: <> (✂✂✂ auto generated {marker} start ✂✂✂)',
|
|
21
|
+
end_marker_line=f'[comment]: <> (✂✂✂ auto generated {marker} end ✂✂✂)',
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ReadmeTestCase(BaseTestCase):
|
|
26
|
+
def test_devshell_help(self):
|
|
27
|
+
with NoColorEnvRich():
|
|
28
|
+
stdout = invoke(cli_bin=DEV_SHELL_PKG_PATH.parent / 'devshell.py', args=['help'])
|
|
29
|
+
|
|
30
|
+
assert_in(
|
|
31
|
+
content=stdout,
|
|
32
|
+
parts=(
|
|
33
|
+
'dev-shell commands',
|
|
34
|
+
'fix_code_style',
|
|
35
|
+
'publish',
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
assert_cli_help_in_readme(text_block=stdout, marker='main help')
|
|
@@ -1,68 +1,74 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Just some shortcuts to print colorful stuff using rich
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
from cmd2.rich_utils import rich_text_to_string
|
|
5
5
|
from rich.console import Console
|
|
6
6
|
from rich.text import Text
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
def style(msg: str, style: str) -> str:
|
|
10
|
+
if not isinstance(msg, str):
|
|
11
|
+
msg = str(msg) # e.g.: Path instance -> str
|
|
12
|
+
return rich_text_to_string(Text(msg, style=style))
|
|
13
|
+
|
|
14
|
+
|
|
9
15
|
def red(msg: str) -> str:
|
|
10
|
-
return
|
|
16
|
+
return style(msg, style='red')
|
|
11
17
|
|
|
12
18
|
|
|
13
19
|
def green(msg: str) -> str:
|
|
14
|
-
return
|
|
20
|
+
return style(msg, style='green')
|
|
15
21
|
|
|
16
22
|
|
|
17
23
|
def yellow(msg: str) -> str:
|
|
18
|
-
return
|
|
24
|
+
return style(msg, style='yellow')
|
|
19
25
|
|
|
20
26
|
|
|
21
27
|
def blue(msg: str) -> str:
|
|
22
|
-
return
|
|
28
|
+
return style(msg, style='blue')
|
|
23
29
|
|
|
24
30
|
|
|
25
31
|
def magenta(msg: str) -> str:
|
|
26
|
-
return
|
|
32
|
+
return style(msg, style='magenta')
|
|
27
33
|
|
|
28
34
|
|
|
29
35
|
def cyan(msg: str) -> str:
|
|
30
|
-
return
|
|
36
|
+
return style(msg, style='cyan')
|
|
31
37
|
|
|
32
38
|
|
|
33
39
|
def white(msg: str) -> str:
|
|
34
|
-
return
|
|
40
|
+
return style(msg, style='white')
|
|
35
41
|
|
|
36
42
|
|
|
37
43
|
###################################################################################################
|
|
38
44
|
|
|
39
45
|
|
|
40
46
|
def bright_red(msg: str) -> str:
|
|
41
|
-
return
|
|
47
|
+
return style(msg, style='bright_red')
|
|
42
48
|
|
|
43
49
|
|
|
44
50
|
def bright_green(msg: str) -> str:
|
|
45
|
-
return
|
|
51
|
+
return style(msg, style='bright_green')
|
|
46
52
|
|
|
47
53
|
|
|
48
54
|
def bright_yellow(msg: str) -> str:
|
|
49
|
-
return
|
|
55
|
+
return style(msg, style='bright_yellow')
|
|
50
56
|
|
|
51
57
|
|
|
52
58
|
def bright_blue(msg: str) -> str:
|
|
53
|
-
return
|
|
59
|
+
return style(msg, style='bright_blue')
|
|
54
60
|
|
|
55
61
|
|
|
56
62
|
def bright_magenta(msg: str) -> str:
|
|
57
|
-
return
|
|
63
|
+
return style(msg, style='bright_magenta')
|
|
58
64
|
|
|
59
65
|
|
|
60
66
|
def bright_cyan(msg: str) -> str:
|
|
61
|
-
return
|
|
67
|
+
return style(msg, style='bright_cyan')
|
|
62
68
|
|
|
63
69
|
|
|
64
70
|
def bright_white(msg: str) -> str:
|
|
65
|
-
return
|
|
71
|
+
return style(msg, style='bright_white')
|
|
66
72
|
|
|
67
73
|
|
|
68
74
|
###################################################################################################
|
|
@@ -71,3 +77,4 @@ def bright_white(msg: str) -> str:
|
|
|
71
77
|
def print_error(err: str) -> None:
|
|
72
78
|
console = Console()
|
|
73
79
|
console.print(f'\n{err}\n', style='bold bright_red')
|
|
80
|
+
|
|
@@ -70,12 +70,18 @@ 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)
|
|
75
|
+
|
|
76
|
+
# Activate git pre-commit hooks:
|
|
77
|
+
verbose_check_call(uv_bin, 'run', '--active', '-m', 'pre_commit', 'install')
|
|
78
|
+
|
|
73
79
|
# The cmd2 shell should not abort on Ctrl-C => ignore "Interrupt from keyboard" signal:
|
|
74
80
|
signal.signal(signal.SIGINT, noop_signal_handler)
|
|
75
81
|
|
|
76
82
|
# Call our entry point CLI:
|
|
77
83
|
try:
|
|
78
|
-
verbose_check_call(uv_bin, 'run', '-m', 'dev_shell', *argv[1:])
|
|
84
|
+
verbose_check_call(uv_bin, 'run', '--active', '-m', 'dev_shell', *argv[1:])
|
|
79
85
|
except subprocess.CalledProcessError as err:
|
|
80
86
|
sys.exit(err.returncode)
|
|
81
87
|
|