fast-dev-cli 0.19.2__tar.gz → 0.19.3__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.
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/PKG-INFO +1 -1
- fast_dev_cli-0.19.3/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/fast_dev_cli/cli.py +17 -6
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/pyproject.toml +1 -1
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_exec.py +10 -0
- fast_dev_cli-0.19.2/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/LICENSE +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/README.md +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/fast_dev_cli/py.typed +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/pdm_build.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/scripts/check.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/scripts/deps.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/scripts/format.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/scripts/test.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/__init__.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/assets/uv-tx.lock +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/assets/uv.lock +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/conftest.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_bump.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_deps.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_fast_test.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_functions.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_help.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_lint.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_poetry_version_plugin.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_pypi.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_runserver.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_sync.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_tag.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_upgrade.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_upload.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/test_version.py +0 -0
- {fast_dev_cli-0.19.2 → fast_dev_cli-0.19.3}/tests/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.19.3"
|
|
@@ -139,14 +139,25 @@ class Shell:
|
|
|
139
139
|
@property
|
|
140
140
|
def command(self) -> list[str] | str:
|
|
141
141
|
command: list[str] | str = self._cmd
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
if isinstance(command, str):
|
|
143
|
+
cs = shlex.split(command)
|
|
144
|
+
if "shell" not in self._kw and not (set(self._cmd) & {"|", ">", "&"}):
|
|
145
|
+
command = self.extend_user(cs)
|
|
146
|
+
elif any(i.startswith("~") for i in cs):
|
|
147
|
+
command = re.sub(r" ~", " " + os.path.expanduser("~"), command)
|
|
148
|
+
else:
|
|
149
|
+
command = self.extend_user(command)
|
|
148
150
|
return command
|
|
149
151
|
|
|
152
|
+
@staticmethod
|
|
153
|
+
def extend_user(cs: list[str]) -> list[str]:
|
|
154
|
+
if cs[0] == "echo":
|
|
155
|
+
return cs
|
|
156
|
+
for i, c in enumerate(cs):
|
|
157
|
+
if c.startswith("~"):
|
|
158
|
+
cs[i] = os.path.expanduser(c)
|
|
159
|
+
return cs
|
|
160
|
+
|
|
150
161
|
def _run(self) -> subprocess.CompletedProcess[str]:
|
|
151
162
|
return self.run_by_subprocess(self.command, **self._kw)
|
|
152
163
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
1
3
|
import pytest
|
|
2
4
|
|
|
3
5
|
from fast_dev_cli.cli import Exit, capture_cmd_output, run_by_subprocess
|
|
@@ -15,6 +17,8 @@ def test_exec_dry():
|
|
|
15
17
|
)
|
|
16
18
|
assert "success" in out
|
|
17
19
|
assert "failed" not in out
|
|
20
|
+
out = capture_cmd_output('fast exec "python ~/0.py" --dry')
|
|
21
|
+
assert "--> python ~/0.py" in out
|
|
18
22
|
|
|
19
23
|
|
|
20
24
|
def test_exec():
|
|
@@ -29,6 +33,12 @@ def test_exec():
|
|
|
29
33
|
)
|
|
30
34
|
assert "failed" in out
|
|
31
35
|
assert "success" not in out
|
|
36
|
+
out = capture_cmd_output('fast exec "ls -a ~/"')
|
|
37
|
+
assert "--> ls -a ~" in out
|
|
38
|
+
assert ".bashrc" in out
|
|
39
|
+
home = os.path.expanduser("~")
|
|
40
|
+
expected = capture_cmd_output(f"ls {home}")
|
|
41
|
+
assert not (set(expected.splitlines()) - set(out.splitlines()))
|
|
32
42
|
|
|
33
43
|
|
|
34
44
|
def test_run_by_subprocess(capsys):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.19.2"
|
|
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
|
|
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
|