fast-dev-cli 0.19.7__tar.gz → 0.19.9__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.9}/PKG-INFO +20 -9
  2. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/README.md +19 -8
  3. fast_dev_cli-0.19.9/fast_dev_cli/__init__.py +1 -0
  4. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/fast_dev_cli/cli.py +38 -26
  5. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/pyproject.toml +9 -1
  6. fast_dev_cli-0.19.7/fast_dev_cli/__init__.py +0 -1
  7. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/LICENSE +0 -0
  8. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/fast_dev_cli/__main__.py +0 -0
  9. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/fast_dev_cli/py.typed +0 -0
  10. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/pdm_build.py +0 -0
  11. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/scripts/check.py +0 -0
  12. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/scripts/deps.py +0 -0
  13. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/scripts/format.py +0 -0
  14. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/scripts/test.py +0 -0
  15. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/__init__.py +0 -0
  16. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/assets/uv-tx.lock +0 -0
  17. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/assets/uv-upload-time.lock +0 -0
  18. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/assets/uv.lock +0 -0
  19. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/conftest.py +0 -0
  20. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_bump.py +0 -0
  21. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_deps.py +0 -0
  22. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_exec.py +0 -0
  23. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_fast_test.py +0 -0
  24. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_functions.py +0 -0
  25. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_help.py +0 -0
  26. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_lint.py +0 -0
  27. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_poetry_version_plugin.py +0 -0
  28. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_pypi.py +0 -0
  29. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_runserver.py +0 -0
  30. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_sync.py +0 -0
  31. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_tag.py +0 -0
  32. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_upgrade.py +0 -0
  33. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_upload.py +0 -0
  34. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/tests/test_version.py +0 -0
  35. {fast_dev_cli-0.19.7 → fast_dev_cli-0.19.9}/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.9
4
4
  Summary: Python project development tool.
5
5
  Author-Email: Waket Zheng <waketzheng@gmail.com>>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -78,11 +78,25 @@ Python 3.10+
78
78
 
79
79
  ## Features
80
80
 
81
- - Support poetry/pdm/uv
82
- - Support Windows/MacOS/Linux
81
+ - Support uv/pd/mpoetry
82
+ - Support MacOS/Linux/Windows
83
83
 
84
84
  ## Installation
85
85
 
86
+ - Global install
87
+
88
+ <div class="termy">
89
+
90
+ ```bash
91
+ uv tool install --python 3.14 fastdevcli-slim
92
+ # Or: pipx install fastdevcli-slim
93
+ ```
94
+ *Will create a `fast` command in ~/.local/bin
95
+
96
+ - Install in project
97
+
98
+ </div>
99
+
86
100
  <div class="termy">
87
101
 
88
102
  ```bash
@@ -133,11 +147,8 @@ fast pypi
133
147
  uvx --from fastdevcli-slim fast
134
148
  ```
135
149
 
136
- ## Install global
137
- ```bash
138
- pipx install fastdevcli-slim
139
- ```
140
- Or:
150
+ ## Lint/Check by ty instead of mypy
141
151
  ```bash
142
- uv tool install fastdevcli-slim
152
+ fast lint --ty
153
+ fast check --ty
143
154
  ```
@@ -43,11 +43,25 @@ Python 3.10+
43
43
 
44
44
  ## Features
45
45
 
46
- - Support poetry/pdm/uv
47
- - Support Windows/MacOS/Linux
46
+ - Support uv/pd/mpoetry
47
+ - Support MacOS/Linux/Windows
48
48
 
49
49
  ## Installation
50
50
 
51
+ - Global install
52
+
53
+ <div class="termy">
54
+
55
+ ```bash
56
+ uv tool install --python 3.14 fastdevcli-slim
57
+ # Or: pipx install fastdevcli-slim
58
+ ```
59
+ *Will create a `fast` command in ~/.local/bin
60
+
61
+ - Install in project
62
+
63
+ </div>
64
+
51
65
  <div class="termy">
52
66
 
53
67
  ```bash
@@ -98,11 +112,8 @@ fast pypi
98
112
  uvx --from fastdevcli-slim fast
99
113
  ```
100
114
 
101
- ## Install global
102
- ```bash
103
- pipx install fastdevcli-slim
104
- ```
105
- Or:
115
+ ## Lint/Check by ty instead of mypy
106
116
  ```bash
107
- uv tool install fastdevcli-slim
117
+ fast lint --ty
118
+ fast check --ty
108
119
  ```
@@ -0,0 +1 @@
1
+ __version__ = "0.19.9"
@@ -1163,7 +1163,7 @@ class LintCode(DryRun):
1163
1163
  )
1164
1164
  prefix = ""
1165
1165
  should_run_by_tool = with_prefix
1166
- if not should_run_by_tool:
1166
+ if not should_run_by_tool and "mypy" in str(tools):
1167
1167
  if is_venv() and Path(sys.argv[0]).parent != Path.home().joinpath(
1168
1168
  ".local/bin"
1169
1169
  ): # Virtual environment activated and fast-dev-cli is installed in it
@@ -1177,7 +1177,7 @@ class LintCode(DryRun):
1177
1177
  "You may need to run the following command"
1178
1178
  f" to install ruff:\n\n {command}\n"
1179
1179
  )
1180
- elif "mypy" in str(tools) and cls.missing_mypy_exec():
1180
+ elif cls.missing_mypy_exec():
1181
1181
  should_run_by_tool = True
1182
1182
  if check_call('python -c "import fast_dev_cli"'):
1183
1183
  command = 'python -m pip install -U "fast-dev-cli"'
@@ -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.9"
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