fast-dev-cli 0.19.7__tar.gz → 0.19.8__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.19.7 → fast_dev_cli-0.19.8}/PKG-INFO +1 -1
  2. fast_dev_cli-0.19.8/fast_dev_cli/__init__.py +1 -0
  3. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/fast_dev_cli/cli.py +36 -24
  4. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/pyproject.toml +9 -1
  5. fast_dev_cli-0.19.7/fast_dev_cli/__init__.py +0 -1
  6. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/LICENSE +0 -0
  7. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/README.md +0 -0
  8. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/fast_dev_cli/__main__.py +0 -0
  9. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/fast_dev_cli/py.typed +0 -0
  10. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/pdm_build.py +0 -0
  11. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/scripts/check.py +0 -0
  12. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/scripts/deps.py +0 -0
  13. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/scripts/format.py +0 -0
  14. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/scripts/test.py +0 -0
  15. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/__init__.py +0 -0
  16. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/assets/uv-tx.lock +0 -0
  17. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/assets/uv-upload-time.lock +0 -0
  18. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/assets/uv.lock +0 -0
  19. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/conftest.py +0 -0
  20. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_bump.py +0 -0
  21. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_deps.py +0 -0
  22. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_exec.py +0 -0
  23. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_fast_test.py +0 -0
  24. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_functions.py +0 -0
  25. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_help.py +0 -0
  26. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_lint.py +0 -0
  27. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_poetry_version_plugin.py +0 -0
  28. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_pypi.py +0 -0
  29. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_runserver.py +0 -0
  30. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_sync.py +0 -0
  31. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_tag.py +0 -0
  32. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_upgrade.py +0 -0
  33. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_upload.py +0 -0
  34. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/test_version.py +0 -0
  35. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.8}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fast-dev-cli
3
- Version: 0.19.7
3
+ Version: 0.19.8
4
4
  Summary: Python project development tool.
5
5
  Author-Email: Waket Zheng <waketzheng@gmail.com>>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -0,0 +1 @@
1
+ __version__ = "0.19.8"
@@ -1662,53 +1662,65 @@ class UvPypi(DryRun):
1662
1662
  if rc != 0:
1663
1663
  raise Exit(rc)
1664
1664
 
1665
- @classmethod
1666
- def update_lock(
1667
- cls, p: Path, verbose: bool, quiet: bool, slim: bool = False
1668
- ) -> int:
1669
- text = p.read_text("utf-8")
1665
+ @staticmethod
1666
+ def get_target_content(
1667
+ text: str, verbose: bool, target_registry, target_host: str
1668
+ ) -> str | None:
1670
1669
  registry_pattern = r'(registry = ")(.*?)"'
1671
- replace_registry = functools.partial(
1672
- re.sub, registry_pattern, rf'\1{cls.PYPI}"'
1673
- )
1674
1670
  registry_urls = {i[1] for i in re.findall(registry_pattern, text)}
1675
- download_pattern = r'(url = ")(https?://.*?)(/packages/.*?\.)(gz|whl)"'
1676
- replace_host = functools.partial(
1677
- re.sub, download_pattern, rf'\1{cls.HOST}\3\4"'
1678
- )
1671
+ download_pattern = r'(url = ")(https?://.*?)(/packages/.*?\.)(gz|whl|zip)"'
1679
1672
  download_hosts = {i[1] for i in re.findall(download_pattern, text)}
1680
1673
  if not registry_urls:
1681
- raise ValueError(f"Failed to find pattern {registry_pattern!r} in {p}")
1674
+ raise ValueError(
1675
+ f"Failed to find pattern {registry_pattern!r} in uv lock file"
1676
+ )
1677
+
1678
+ def replace_registry(s: str) -> str:
1679
+ return re.sub(registry_pattern, rf'\1{target_registry}"', s)
1680
+
1681
+ def replace_host(s: str) -> str:
1682
+ return re.sub(download_pattern, rf'\1{target_host}\3\4"', s)
1683
+
1682
1684
  if len(registry_urls) == 1:
1683
1685
  current_registry = registry_urls.pop()
1684
- if current_registry == cls.PYPI:
1685
- if download_hosts == {cls.HOST}:
1686
- if verbose:
1687
- echo(f"Registry of {p} is {cls.PYPI}, no need to change.")
1688
- return 0
1686
+ if current_registry == target_registry:
1687
+ if download_hosts == {target_host}:
1688
+ return None
1689
1689
  else:
1690
1690
  text = replace_registry(text)
1691
1691
  if verbose:
1692
- echo(f"{current_registry} --> {cls.PYPI}")
1692
+ echo(f"{current_registry} --> {target_registry}")
1693
1693
  else:
1694
1694
  # TODO: ask each one to confirm replace
1695
1695
  text = replace_registry(text)
1696
1696
  if verbose:
1697
1697
  for current_registry in sorted(registry_urls):
1698
- echo(f"{current_registry} --> {cls.PYPI}")
1698
+ echo(f"{current_registry} --> {target_registry}")
1699
1699
  if len(download_hosts) == 1:
1700
1700
  current_host = download_hosts.pop()
1701
- if current_host != cls.HOST:
1701
+ if current_host != target_host:
1702
1702
  text = replace_host(text)
1703
1703
  if verbose:
1704
- print(current_host, "-->", cls.HOST)
1704
+ echo(f"{current_host} --> {target_host}")
1705
1705
  elif download_hosts:
1706
1706
  # TODO: ask each one to confirm replace
1707
1707
  text = replace_host(text)
1708
1708
  if verbose:
1709
1709
  for current_host in sorted(download_hosts):
1710
- echo(f"{current_host} --> {cls.HOST}")
1711
- return cls.slim_and_write(cast(str, text), slim, p, verbose, quiet)
1710
+ echo(f"{current_host} --> {target_host}")
1711
+ return text
1712
+
1713
+ @classmethod
1714
+ def update_lock(
1715
+ cls, p: Path, verbose: bool, quiet: bool, slim: bool = False
1716
+ ) -> int:
1717
+ text = p.read_text("utf-8")
1718
+ new_text = cls.get_target_content(text, verbose, cls.PYPI, cls.HOST)
1719
+ if new_text is None:
1720
+ if verbose:
1721
+ echo(f"Registry of {p} is {cls.PYPI}, no need to change.")
1722
+ return 0
1723
+ return cls.slim_and_write(new_text, slim, p, verbose, quiet)
1712
1724
 
1713
1725
  @staticmethod
1714
1726
  def slim_and_write(
@@ -41,7 +41,7 @@ dependencies = [
41
41
  "bumpversion2 >=1.4.3",
42
42
  "pytest >=8.2.0",
43
43
  ]
44
- version = "0.19.7"
44
+ version = "0.19.8"
45
45
 
46
46
  [project.urls]
47
47
  Homepage = "https://github.com/waketzheng/fast-dev-cli"
@@ -161,9 +161,17 @@ omit = [
161
161
  "fast_dev_cli/__main__.py",
162
162
  ]
163
163
 
164
+ [tool.ty.src]
165
+ exclude = [
166
+ "*.bak",
167
+ ]
168
+
164
169
  [tool.ty.rules]
165
170
  unresolved-import = "ignore"
166
171
 
172
+ [tool.ty.environment]
173
+ python-version = "3.10"
174
+
167
175
  [tool.mypy]
168
176
  pretty = true
169
177
  python_version = "3.10"
@@ -1 +0,0 @@
1
- __version__ = "0.19.7"
File without changes
File without changes