fast-dev-cli 0.20.0__tar.gz → 0.20.1__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.20.1}/PKG-INFO +2 -2
  2. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/README.md +1 -1
  3. fast_dev_cli-0.20.1/fast_dev_cli/__init__.py +1 -0
  4. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/fast_dev_cli/cli.py +16 -5
  5. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/pyproject.toml +1 -1
  6. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_pypi.py +13 -4
  7. fast_dev_cli-0.20.0/fast_dev_cli/__init__.py +0 -1
  8. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/LICENSE +0 -0
  9. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/fast_dev_cli/__main__.py +0 -0
  10. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/fast_dev_cli/py.typed +0 -0
  11. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/pdm_build.py +0 -0
  12. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/scripts/check.py +0 -0
  13. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/scripts/deps.py +0 -0
  14. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/scripts/format.py +0 -0
  15. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/scripts/test.py +0 -0
  16. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/__init__.py +0 -0
  17. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/assets/uv-tx.lock +0 -0
  18. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/assets/uv-upload-time.lock +0 -0
  19. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/assets/uv.lock +0 -0
  20. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/conftest.py +0 -0
  21. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_bump.py +0 -0
  22. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_deps.py +0 -0
  23. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_exec.py +0 -0
  24. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_fast_test.py +0 -0
  25. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_functions.py +0 -0
  26. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_help.py +0 -0
  27. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_lint.py +0 -0
  28. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_poetry_version_plugin.py +0 -0
  29. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_runserver.py +0 -0
  30. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_sync.py +0 -0
  31. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_tag.py +0 -0
  32. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_upgrade.py +0 -0
  33. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_upload.py +0 -0
  34. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/tests/test_version.py +0 -0
  35. {fast_dev_cli-0.20.0 → fast_dev_cli-0.20.1}/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.20.1
4
4
  Summary: Python project development tool.
5
5
  Author-Email: Waket Zheng <waketzheng@gmail.com>>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -100,7 +100,7 @@ uv tool install --python 3.14 fastdevcli-slim
100
100
  ```bash
101
101
  pip install fast-dev-cli
102
102
  ```
103
- *Will install: fast-dev-cli emoji typer-slim mypy bumpversion2 pytest coverage*
103
+ *Will install: fast-dev-cli emoji typer-slim pytest coverage*
104
104
 
105
105
  </div>
106
106
 
@@ -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-slim pytest coverage*
71
71
 
72
72
  </div>
73
73
 
@@ -0,0 +1 @@
1
+ __version__ = "0.20.1"
@@ -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
@@ -39,7 +39,7 @@ dependencies = [
39
39
  "coverage >=7.5.1",
40
40
  "pytest >=8.2.0",
41
41
  ]
42
- version = "0.20.0"
42
+ version = "0.20.1"
43
43
 
44
44
  [project.urls]
45
45
  Homepage = "https://github.com/waketzheng/fast-dev-cli"
@@ -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
+ )
@@ -1 +0,0 @@
1
- __version__ = "0.20.0"
File without changes