dev-shell 0.7.0__tar.gz → 0.8.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.
- {dev_shell-0.7.0 → dev_shell-0.8.0}/PKG-INFO +8 -5
- {dev_shell-0.7.0 → dev_shell-0.8.0}/README.md +5 -1
- dev_shell-0.8.0/dev_shell/__init__.py +1 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/bootstrap-source.py +21 -13
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/test_bootstrap.py +10 -6
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/utils.py +1 -1
- {dev_shell-0.7.0 → dev_shell-0.8.0}/pyproject.toml +3 -8
- dev_shell-0.7.0/dev_shell/__init__.py +0 -1
- {dev_shell-0.7.0 → dev_shell-0.8.0}/LICENSE +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/base_cmd2_app.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/command_sets/__init__.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/command_sets/dev_shell_commands.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/config.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/constants.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/dev_shell_app.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/__init__.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/constants.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/fixtures.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/test_dev_shell_app.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/test_source_file.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/tests/test_subprocess_utils.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/utils/__init__.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/utils/assertion.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/utils/colorful.py +0 -0
- {dev_shell-0.7.0 → dev_shell-0.8.0}/dev_shell/utils/subprocess_utils.py +0 -0
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dev-shell
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Developer shell for easy startup...
|
|
5
5
|
Home-page: https://github.com/jedie/dev-shell
|
|
6
6
|
License: GNU General Public License v3.0
|
|
7
7
|
Author: Jens Diemer
|
|
8
8
|
Author-email: python@jensdiemer.de
|
|
9
|
-
Requires-Python: >=3.9,<4.0
|
|
9
|
+
Requires-Python: >=3.9,<4.0
|
|
10
10
|
Classifier: License :: Other/Proprietary License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Requires-Dist: cmd2
|
|
16
|
-
Requires-Dist: gnureadline ; sys_platform == "darwin"
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
18
17
|
|
|
19
18
|
# A "dev-shell" for Python projects ;)
|
|
@@ -122,8 +121,12 @@ See also github test configuration: [.github/workflows/test.yml](https://github.
|
|
|
122
121
|
|
|
123
122
|
## History
|
|
124
123
|
|
|
125
|
-
* [*dev*](https://github.com/jedie/dev-shell/compare/v0.
|
|
124
|
+
* [*dev*](https://github.com/jedie/dev-shell/compare/v0.8.0...main)
|
|
126
125
|
* TBC
|
|
126
|
+
* [0.8.0 - 2024-04-09](https://github.com/jedie/dev-shell/compare/v0.7.0...v0.8.0)
|
|
127
|
+
* Remove "gnureadline" as dependency
|
|
128
|
+
* update boot script
|
|
129
|
+
* update requirements
|
|
127
130
|
* [0.7.0 - 2023-04-25](https://github.com/jedie/dev-shell/compare/v0.6.1...v0.7.0)
|
|
128
131
|
* Update test matrix
|
|
129
132
|
* update requirements
|
|
@@ -104,8 +104,12 @@ See also github test configuration: [.github/workflows/test.yml](https://github.
|
|
|
104
104
|
|
|
105
105
|
## History
|
|
106
106
|
|
|
107
|
-
* [*dev*](https://github.com/jedie/dev-shell/compare/v0.
|
|
107
|
+
* [*dev*](https://github.com/jedie/dev-shell/compare/v0.8.0...main)
|
|
108
108
|
* TBC
|
|
109
|
+
* [0.8.0 - 2024-04-09](https://github.com/jedie/dev-shell/compare/v0.7.0...v0.8.0)
|
|
110
|
+
* Remove "gnureadline" as dependency
|
|
111
|
+
* update boot script
|
|
112
|
+
* update requirements
|
|
109
113
|
* [0.7.0 - 2023-04-25](https://github.com/jedie/dev-shell/compare/v0.6.1...v0.7.0)
|
|
110
114
|
* Update test matrix
|
|
111
115
|
* update requirements
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.8.0'
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
This file is from: https://pypi.org/project/dev-shell/
|
|
10
10
|
Source: https://github.com/jedie/dev-shell/blob/main/devshell.py
|
|
11
11
|
|
|
12
|
-
:copyleft: 2021-
|
|
12
|
+
:copyleft: 2021-2024 by Jens Diemer
|
|
13
13
|
:license: GNU GPL v3 or above
|
|
14
14
|
"""
|
|
15
|
-
|
|
16
15
|
import argparse
|
|
17
16
|
import hashlib
|
|
17
|
+
import shlex
|
|
18
18
|
import signal
|
|
19
19
|
import subprocess
|
|
20
20
|
import sys
|
|
@@ -22,17 +22,25 @@ import venv
|
|
|
22
22
|
from pathlib import Path
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
def print_no_pip_error():
|
|
26
|
+
print('Error: Pip not available!')
|
|
27
|
+
print('Hint: "apt-get install python3-venv"\n')
|
|
28
|
+
|
|
29
|
+
|
|
25
30
|
try:
|
|
26
|
-
|
|
31
|
+
from ensurepip import version
|
|
27
32
|
except ModuleNotFoundError as err:
|
|
28
33
|
print(err)
|
|
29
34
|
print('-' * 100)
|
|
30
|
-
|
|
31
|
-
print('Hint: "apt-get install python3-venv"\n')
|
|
35
|
+
print_no_pip_error()
|
|
32
36
|
raise
|
|
37
|
+
else:
|
|
38
|
+
if not version():
|
|
39
|
+
print_no_pip_error()
|
|
40
|
+
sys.exit(-1)
|
|
33
41
|
|
|
34
42
|
|
|
35
|
-
assert sys.version_info >= (3,
|
|
43
|
+
assert sys.version_info >= (3, 9), f'Python version {sys.version_info} is too old!'
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
if sys.platform == 'win32': # wtf
|
|
@@ -60,25 +68,24 @@ PROJECT_SHELL_SCRIPT = BIN_PATH / 'devshell'
|
|
|
60
68
|
|
|
61
69
|
|
|
62
70
|
def get_dep_hash():
|
|
63
|
-
"""
|
|
71
|
+
"""Get SHA512 hash from lock file content."""
|
|
64
72
|
return hashlib.sha512(DEP_LOCK_PATH.read_bytes()).hexdigest()
|
|
65
73
|
|
|
66
74
|
|
|
67
75
|
def store_dep_hash():
|
|
68
|
-
"""
|
|
76
|
+
"""Generate .venv/.dep_hash"""
|
|
69
77
|
DEP_HASH_PATH.write_text(get_dep_hash())
|
|
70
78
|
|
|
71
79
|
|
|
72
80
|
def venv_up2date():
|
|
73
|
-
"""
|
|
81
|
+
"""Is existing .venv is up-to-date?"""
|
|
74
82
|
if DEP_HASH_PATH.is_file():
|
|
75
83
|
return DEP_HASH_PATH.read_text() == get_dep_hash()
|
|
76
84
|
return False
|
|
77
85
|
|
|
78
86
|
|
|
79
87
|
def verbose_check_call(*popen_args):
|
|
80
|
-
|
|
81
|
-
print(f'\n+ {" ".join(popen_args)}\n')
|
|
88
|
+
print(f'\n+ {shlex.join(str(arg) for arg in popen_args)}\n')
|
|
82
89
|
return subprocess.check_call(popen_args)
|
|
83
90
|
|
|
84
91
|
|
|
@@ -86,7 +93,6 @@ def noop_signal_handler(signal_num, frame):
|
|
|
86
93
|
"""
|
|
87
94
|
Signal handler that does nothing: Used to ignore "Ctrl-C" signals
|
|
88
95
|
"""
|
|
89
|
-
pass
|
|
90
96
|
|
|
91
97
|
|
|
92
98
|
def main(argv):
|
|
@@ -119,12 +125,14 @@ def main(argv):
|
|
|
119
125
|
print('Create virtual env here:', VENV_PATH.absolute())
|
|
120
126
|
builder = venv.EnvBuilder(symlinks=True, upgrade=True, with_pip=True)
|
|
121
127
|
builder.create(env_dir=VENV_PATH)
|
|
128
|
+
# Update pip
|
|
129
|
+
verbose_check_call(PYTHON_PATH, '-m', 'pip', 'install', '-U', 'pip')
|
|
122
130
|
|
|
123
131
|
# install/update "pip" and "poetry":
|
|
124
132
|
if not POETRY_PATH.is_file() or force_update:
|
|
125
133
|
# Note: Under Windows pip.exe can't replace this own .exe file, so use the module way:
|
|
126
134
|
verbose_check_call(PYTHON_PATH, '-m', 'pip', 'install', '-U', 'pip', 'setuptools')
|
|
127
|
-
verbose_check_call(PIP_PATH, 'install', 'poetry
|
|
135
|
+
verbose_check_call(PIP_PATH, 'install', 'poetry')
|
|
128
136
|
|
|
129
137
|
# install via poetry, if:
|
|
130
138
|
# 1. .venv not exists
|
|
@@ -88,12 +88,16 @@ class BootstrapTestCase(TestCase):
|
|
|
88
88
|
assert stderr == ''
|
|
89
89
|
assert f'{VENV_POETRY} install' in stdout
|
|
90
90
|
assert f'{DEVSHELL_CALL}\n' in stdout
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
self.assertEqual(
|
|
92
|
+
check_calls,
|
|
93
|
+
[
|
|
94
|
+
f'{VENV_PYTHON} -m pip install -U pip',
|
|
95
|
+
f'{VENV_PYTHON} -m pip install -U pip setuptools',
|
|
96
|
+
f'{VENV_PIP} install poetry',
|
|
97
|
+
f'{VENV_POETRY} install',
|
|
98
|
+
DEVSHELL_CALL,
|
|
99
|
+
],
|
|
100
|
+
)
|
|
97
101
|
create_mock.assert_called_once_with(env_dir=VENV_PATH)
|
|
98
102
|
|
|
99
103
|
def test_help(self):
|
|
@@ -23,7 +23,7 @@ def call_mocked_subprocess(func_name, func, *args, catch_sys_exit=False, **kwarg
|
|
|
23
23
|
if isinstance(popenargs, str):
|
|
24
24
|
command_str = popenargs
|
|
25
25
|
else:
|
|
26
|
-
command_str = ' '.join(popenargs)
|
|
26
|
+
command_str = ' '.join([str(arg) for arg in popenargs])
|
|
27
27
|
|
|
28
28
|
cwd = kwargs.get('cwd')
|
|
29
29
|
if cwd:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "dev-shell"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.8.0"
|
|
4
|
+
description = "Developer shell for easy startup..."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = ["Jens Diemer <python@jensdiemer.de>"]
|
|
7
7
|
homepage = "https://github.com/jedie/dev-shell"
|
|
@@ -14,13 +14,9 @@ packages = [
|
|
|
14
14
|
devshell = 'dev_shell.dev_shell_app:devshell_cmdloop'
|
|
15
15
|
|
|
16
16
|
[tool.poetry.dependencies]
|
|
17
|
-
python = ">=3.9,<4.0
|
|
17
|
+
python = ">=3.9,<4.0"
|
|
18
18
|
cmd2 = "*" # https://github.com/python-cmd2/cmd2
|
|
19
19
|
|
|
20
|
-
# fix completion for Mac OS:
|
|
21
|
-
gnureadline = { version = "*", markers = "sys_platform == 'darwin'" }
|
|
22
|
-
|
|
23
|
-
|
|
24
20
|
[tool.poetry.dev-dependencies]
|
|
25
21
|
cmd2_ext_test = "*"
|
|
26
22
|
poetry-publish = "*" # https://github.com/jedie/poetry-publish
|
|
@@ -42,7 +38,6 @@ build-backend = "poetry.core.masonry.api"
|
|
|
42
38
|
src = ['.',]
|
|
43
39
|
revision = "origin/main..."
|
|
44
40
|
line_length = 100
|
|
45
|
-
verbose = true
|
|
46
41
|
skip_string_normalization = true
|
|
47
42
|
diff = false
|
|
48
43
|
check = false
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.7.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|