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.
Files changed (35) hide show
  1. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/PKG-INFO +4 -6
  2. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/README.md +2 -2
  3. fast_dev_cli-0.21.0/fast_dev_cli/__init__.py +1 -0
  4. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/cli.py +17 -6
  5. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/pyproject.toml +4 -6
  6. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_exec.py +1 -1
  7. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_pypi.py +13 -4
  8. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_sync.py +2 -2
  9. fast_dev_cli-0.20.0/fast_dev_cli/__init__.py +0 -1
  10. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/LICENSE +0 -0
  11. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/__main__.py +0 -0
  12. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/fast_dev_cli/py.typed +0 -0
  13. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/pdm_build.py +0 -0
  14. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/check.py +0 -0
  15. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/deps.py +0 -0
  16. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/format.py +0 -0
  17. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/scripts/test.py +0 -0
  18. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/__init__.py +0 -0
  19. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv-tx.lock +0 -0
  20. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv-upload-time.lock +0 -0
  21. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/assets/uv.lock +0 -0
  22. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/conftest.py +0 -0
  23. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_bump.py +0 -0
  24. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_deps.py +0 -0
  25. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_fast_test.py +0 -0
  26. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_functions.py +0 -0
  27. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_help.py +0 -0
  28. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_lint.py +0 -0
  29. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_poetry_version_plugin.py +0 -0
  30. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_runserver.py +0 -0
  31. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_tag.py +0 -0
  32. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_upgrade.py +0 -0
  33. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_upload.py +0 -0
  34. {fast_dev_cli-0.20.0 → fast_dev_cli-0.21.0}/tests/test_version.py +0 -0
  35. {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.20.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-slim<1,>=0.12.3
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/pd/mpoetry
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-slim mypy bumpversion2 pytest coverage*
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/pd/mpoetry
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-slim mypy bumpversion2 pytest coverage*
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
- target_register, target_host = cls.get_register_from_uv_config()
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
- @staticmethod
1741
- def get_register_from_uv_config() -> tuple[str, str]:
1742
- config_dir = "AppData/Roaming" if is_windows() else ".config"
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-slim >=0.12.3,<1",
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.20.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
- "venv*.bak/*",
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 ".bashrc" in out
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
- try:
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