fast-dev-cli 0.20.0__tar.gz → 0.21.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.
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/PKG-INFO +4 -6
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/README.md +2 -2
- fast_dev_cli-0.21.0/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/cli.py +17 -6
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/pyproject.toml +4 -6
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_exec.py +1 -1
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_pypi.py +13 -4
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_sync.py +2 -2
- fast_dev_cli-0.20.0/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/LICENSE +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/py.typed +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/pdm_build.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/check.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/deps.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/format.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/test.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/__init__.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv-tx.lock +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv-upload-time.lock +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv.lock +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/conftest.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_bump.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_deps.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_fast_test.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_functions.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_help.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_lint.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_poetry_version_plugin.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_runserver.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_tag.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_upgrade.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_upload.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_version.py +0 -0
- {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fast-dev-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.21.0
|
|
4
4
|
Summary: Python project development tool.
|
|
5
5
|
Author-Email: Waket Zheng <waketzheng@gmail.com>>
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -21,10 +21,8 @@ Classifier: Typing :: Typed
|
|
|
21
21
|
Classifier: License :: OSI Approved :: MIT License
|
|
22
22
|
Project-URL: Homepage, https://github.com/waketzheng/fast-dev-cli
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
|
-
Requires-Dist: typer
|
|
24
|
+
Requires-Dist: typer<1,>=0.24.0
|
|
25
25
|
Requires-Dist: tomli<3,>=2.0.1; python_version < "3.11"
|
|
26
|
-
Requires-Dist: emoji>=2.12.1
|
|
27
|
-
Requires-Dist: packaging>=20.5
|
|
28
26
|
Requires-Dist: coverage>=7.5.1
|
|
29
27
|
Requires-Dist: pytest>=8.2.0
|
|
30
28
|
Provides-Extra: include-optional-dependencies
|
|
@@ -76,7 +74,7 @@ Python 3.10+
|
|
|
76
74
|
|
|
77
75
|
## Features
|
|
78
76
|
|
|
79
|
-
- Support uv/
|
|
77
|
+
- Support uv/pdm/poetry
|
|
80
78
|
- Support MacOS/Linux/Windows
|
|
81
79
|
|
|
82
80
|
## Installation
|
|
@@ -100,7 +98,7 @@ uv tool install --python 3.14 fastdevcli-slim
|
|
|
100
98
|
```bash
|
|
101
99
|
pip install fast-dev-cli
|
|
102
100
|
```
|
|
103
|
-
*Will install: fast-dev-cli emoji typer
|
|
101
|
+
*Will install: fast-dev-cli emoji typer packaging pytest coverage*
|
|
104
102
|
|
|
105
103
|
</div>
|
|
106
104
|
|
|
@@ -43,7 +43,7 @@ Python 3.10+
|
|
|
43
43
|
|
|
44
44
|
## Features
|
|
45
45
|
|
|
46
|
-
- Support uv/
|
|
46
|
+
- Support uv/pdm/poetry
|
|
47
47
|
- Support MacOS/Linux/Windows
|
|
48
48
|
|
|
49
49
|
## Installation
|
|
@@ -67,7 +67,7 @@ uv tool install --python 3.14 fastdevcli-slim
|
|
|
67
67
|
```bash
|
|
68
68
|
pip install fast-dev-cli
|
|
69
69
|
```
|
|
70
|
-
*Will install: fast-dev-cli emoji typer
|
|
70
|
+
*Will install: fast-dev-cli emoji typer packaging pytest coverage*
|
|
71
71
|
|
|
72
72
|
</div>
|
|
73
73
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.21.0"
|
|
@@ -1398,7 +1398,7 @@ class Sync(DryRun):
|
|
|
1398
1398
|
return f"python -m pip install -r {self.filename}"
|
|
1399
1399
|
prefix = "" if is_venv() else f"{tool} run "
|
|
1400
1400
|
ensure_pip = " {1}python -m ensurepip && {1}python -m pip install -U pip &&"
|
|
1401
|
-
export_cmd = "uv export --no-hashes --all-extras --frozen"
|
|
1401
|
+
export_cmd = "uv export --no-hashes --all-extras --all-groups --frozen"
|
|
1402
1402
|
if tool in ("poetry", "pdm"):
|
|
1403
1403
|
export_cmd = f"{tool} export --without-hashes --with=dev"
|
|
1404
1404
|
if tool == "poetry":
|
|
@@ -1729,7 +1729,14 @@ class UvPypi(DryRun):
|
|
|
1729
1729
|
text = p.read_text("utf-8")
|
|
1730
1730
|
target_register, target_host = cls.PYPI, cls.HOST
|
|
1731
1731
|
if reverse:
|
|
1732
|
-
|
|
1732
|
+
try:
|
|
1733
|
+
target_register, target_host = cls.get_register_from_uv_config()
|
|
1734
|
+
except FileNotFoundError:
|
|
1735
|
+
if verbose:
|
|
1736
|
+
echo("Skip register reverse as global uv config file not found.")
|
|
1737
|
+
if quiet:
|
|
1738
|
+
return 0
|
|
1739
|
+
return 1
|
|
1733
1740
|
new_text = cls.get_target_content(text, verbose, target_register, target_host)
|
|
1734
1741
|
if new_text is None:
|
|
1735
1742
|
if verbose:
|
|
@@ -1737,15 +1744,19 @@ class UvPypi(DryRun):
|
|
|
1737
1744
|
return 0
|
|
1738
1745
|
return cls.slim_and_write(new_text, slim, p, verbose, quiet)
|
|
1739
1746
|
|
|
1740
|
-
@
|
|
1741
|
-
def get_register_from_uv_config() -> tuple[str, str]:
|
|
1742
|
-
|
|
1743
|
-
config_file = Path.home() / config_dir / "uv/uv.toml"
|
|
1747
|
+
@classmethod
|
|
1748
|
+
def get_register_from_uv_config(cls) -> tuple[str, str]:
|
|
1749
|
+
config_file = cls.get_uv_config_file()
|
|
1744
1750
|
text = config_file.read_text("utf-8")
|
|
1745
1751
|
doc = tomllib.loads(text)
|
|
1746
1752
|
index_url = doc["index"][0]["url"]
|
|
1747
1753
|
return index_url, index_url.replace("/simple", "").rstrip("/")
|
|
1748
1754
|
|
|
1755
|
+
@staticmethod
|
|
1756
|
+
def get_uv_config_file() -> Path:
|
|
1757
|
+
config_dir = "AppData/Roaming" if is_windows() else ".config"
|
|
1758
|
+
return Path.home() / config_dir / "uv/uv.toml"
|
|
1759
|
+
|
|
1749
1760
|
@staticmethod
|
|
1750
1761
|
def slim_and_write(
|
|
1751
1762
|
text: str, slim: bool, p: Path, verbose: bool, quiet: bool
|
|
@@ -32,14 +32,12 @@ classifiers = [
|
|
|
32
32
|
"License :: OSI Approved :: MIT License",
|
|
33
33
|
]
|
|
34
34
|
dependencies = [
|
|
35
|
-
"typer
|
|
35
|
+
"typer>=0.24.0,<1",
|
|
36
36
|
"tomli >=2.0.1,<3; python_version < '3.11'",
|
|
37
|
-
"emoji >=2.12.1",
|
|
38
|
-
"packaging >=20.5",
|
|
39
37
|
"coverage >=7.5.1",
|
|
40
38
|
"pytest >=8.2.0",
|
|
41
39
|
]
|
|
42
|
-
version = "0.
|
|
40
|
+
version = "0.21.0"
|
|
43
41
|
|
|
44
42
|
[project.urls]
|
|
45
43
|
Homepage = "https://github.com/waketzheng/fast-dev-cli"
|
|
@@ -141,9 +139,8 @@ source = [
|
|
|
141
139
|
"fast_dev_cli",
|
|
142
140
|
]
|
|
143
141
|
omit = [
|
|
144
|
-
"__pypackages__/*",
|
|
145
142
|
".venv/*",
|
|
146
|
-
"
|
|
143
|
+
"*.bak/*",
|
|
147
144
|
]
|
|
148
145
|
context = "${CONTEXT}"
|
|
149
146
|
|
|
@@ -167,6 +164,7 @@ exclude = [
|
|
|
167
164
|
[tool.ty.rules]
|
|
168
165
|
unresolved-import = "ignore"
|
|
169
166
|
unused-ignore-comment = "ignore"
|
|
167
|
+
unused-type-ignore-comment = "ignore"
|
|
170
168
|
|
|
171
169
|
[tool.ty.environment]
|
|
172
170
|
python-version = "3.10"
|
|
@@ -35,7 +35,7 @@ def test_exec():
|
|
|
35
35
|
assert "success" not in out
|
|
36
36
|
out = capture_cmd_output('fast exec "ls -a ~/"')
|
|
37
37
|
assert "--> ls -a ~" in out
|
|
38
|
-
assert ".
|
|
38
|
+
assert ".bash" in out
|
|
39
39
|
home = os.path.expanduser("~")
|
|
40
40
|
expected = capture_cmd_output(f"ls {home}")
|
|
41
41
|
assert not (set(expected.splitlines()) - set(out.splitlines()))
|
|
@@ -82,7 +82,7 @@ def test_pypi_slim(tmp_work_dir, capsys):
|
|
|
82
82
|
assert "upload-time" not in new_text
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
def test_pypi_reverse(tmp_work_dir):
|
|
85
|
+
def test_pypi_reverse(tmp_work_dir, mocker, capsys):
|
|
86
86
|
origin_lock = ASSERTS_DIR / "uv-upload-time.lock"
|
|
87
87
|
lock_file = Path("uv.lock")
|
|
88
88
|
Path("pyproject.toml").touch()
|
|
@@ -94,16 +94,25 @@ def test_pypi_reverse(tmp_work_dir):
|
|
|
94
94
|
assert "aliyun" in text and "pypi.org" not in text
|
|
95
95
|
assert "aliyun" not in new_text and "pypi.org" in new_text
|
|
96
96
|
assert "upload-time" in new_text
|
|
97
|
-
|
|
98
|
-
pypi(reverse=True, verbose=True, quiet=True)
|
|
99
|
-
except FileNotFoundError:
|
|
97
|
+
if not UvPypi.get_uv_config_file().exists():
|
|
100
98
|
run_and_echo("uvx pip-conf-mirror --uv aliyun")
|
|
101
99
|
pypi(reverse=True, verbose=True, quiet=True)
|
|
102
100
|
new_text = lock_file.read_text("utf-8")
|
|
103
101
|
assert "aliyun" in new_text and "pypi.org" not in new_text
|
|
104
102
|
else:
|
|
103
|
+
pypi(reverse=True, verbose=True, quiet=True)
|
|
105
104
|
new_text = lock_file.read_text("utf-8")
|
|
106
105
|
assert "pypi.org" not in new_text
|
|
107
106
|
register_url = UvPypi.get_register_from_uv_config()[0]
|
|
108
107
|
assert register_url in new_text
|
|
109
108
|
assert "upload-time" in new_text
|
|
109
|
+
# Check output for uv config file not exist case
|
|
110
|
+
mocker.patch(
|
|
111
|
+
"fast_dev_cli.cli.UvPypi.get_uv_config_file",
|
|
112
|
+
return_value=Path("not-exist-file"),
|
|
113
|
+
)
|
|
114
|
+
pypi(reverse=True, verbose=True, quiet=True)
|
|
115
|
+
assert (
|
|
116
|
+
"Skip register reverse as global uv config file not found."
|
|
117
|
+
in capsys.readouterr().out
|
|
118
|
+
)
|
|
@@ -210,12 +210,12 @@ def test_sync_uv(mocker, tmp_path):
|
|
|
210
210
|
toml.with_name("uv.lock").write_text(UV_LOCK_EXAMPLE)
|
|
211
211
|
assert (
|
|
212
212
|
Sync("req.txt", "", True, dry=True).gen()
|
|
213
|
-
== "uv export --no-hashes --all-extras --frozen -o req.txt && uv run python -m ensurepip && uv run python -m pip install -U pip && uv run python -m pip install -r req.txt"
|
|
213
|
+
== "uv export --no-hashes --all-extras --all-groups --frozen -o req.txt && uv run python -m ensurepip && uv run python -m pip install -U pip && uv run python -m pip install -r req.txt"
|
|
214
214
|
)
|
|
215
215
|
run_and_echo("uv run python -m ensurepip")
|
|
216
216
|
assert (
|
|
217
217
|
Sync("req.txt", "", True, dry=True).gen()
|
|
218
|
-
== "uv export --no-hashes --all-extras --frozen -o req.txt && uv run python -m pip install -r req.txt"
|
|
218
|
+
== "uv export --no-hashes --all-extras --all-groups --frozen -o req.txt && uv run python -m pip install -r req.txt"
|
|
219
219
|
)
|
|
220
220
|
|
|
221
221
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.20.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
|
|
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
|