fast-dev-cli 0.11.2__tar.gz → 0.11.3__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 (27) hide show
  1. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/PKG-INFO +1 -1
  2. fast_dev_cli-0.11.3/fast_dev_cli/__init__.py +1 -0
  3. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/fast_dev_cli/cli.py +18 -6
  4. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/pyproject.toml +1 -1
  5. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_bump.py +13 -0
  6. fast_dev_cli-0.11.2/fast_dev_cli/__init__.py +0 -1
  7. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/LICENSE +0 -0
  8. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/README.md +0 -0
  9. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/fast_dev_cli/__main__.py +0 -0
  10. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/fast_dev_cli/py.typed +0 -0
  11. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/pdm_build.py +0 -0
  12. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/scripts/check.py +0 -0
  13. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/scripts/format.py +0 -0
  14. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/scripts/test.py +0 -0
  15. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/__init__.py +0 -0
  16. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/conftest.py +0 -0
  17. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_fast_test.py +0 -0
  18. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_functions.py +0 -0
  19. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_lint.py +0 -0
  20. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_poetry_version_plugin.py +0 -0
  21. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_runserver.py +0 -0
  22. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_sync.py +0 -0
  23. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_tag.py +0 -0
  24. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_upgrade.py +0 -0
  25. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_upload.py +0 -0
  26. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/test_version.py +0 -0
  27. {fast_dev_cli-0.11.2 → fast_dev_cli-0.11.3}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fast-dev-cli
3
- Version: 0.11.2
3
+ Version: 0.11.3
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.11.3"
@@ -213,16 +213,28 @@ class BumpUp(DryRun):
213
213
  @staticmethod
214
214
  def parse_filename() -> str:
215
215
  toml_text = Project.load_toml_text()
216
- if not Project.manage_by_poetry():
217
- # version = { source = "file", path = "fast_dev_cli/cli.py" }
218
- for line in toml_text.splitlines():
219
- if not line.startswith("version = "):
220
- continue
221
- return line.split('path = "', 1)[-1].split('"')[0]
222
216
  context = tomllib.loads(toml_text)
217
+ try:
218
+ ver = context["project"]["version"]
219
+ except KeyError:
220
+ pass
221
+ else:
222
+ if isinstance(ver, str) and re.match(r"\d+\.\d+\.\d+", ver):
223
+ return TOML_FILE
223
224
  try:
224
225
  version_value = context["tool"]["poetry"]["version"]
225
226
  except KeyError:
227
+ if not Project.manage_by_poetry():
228
+ # version = { source = "file", path = "fast_dev_cli/__init__.py" }
229
+ v_key = "version = "
230
+ p_key = 'path = "'
231
+ for line in toml_text.splitlines():
232
+ if not line.startswith(v_key):
233
+ continue
234
+ if p_key in (value := line.split(v_key, 1)[-1].split("#")[0]):
235
+ filename = value.split(p_key, 1)[-1].split('"')[0]
236
+ if Project.get_work_dir().joinpath(filename).exists():
237
+ return filename
226
238
  return TOML_FILE
227
239
  if version_value in ("0", "0.0.0"):
228
240
  try:
@@ -40,7 +40,7 @@ dependencies = [
40
40
  "bumpversion2 >=1.4.3,<2",
41
41
  "pytest >=8.2.0,<9",
42
42
  ]
43
- version = "0.11.2"
43
+ version = "0.11.3"
44
44
 
45
45
  [project.urls]
46
46
  Homepage = "https://github.com/waketzheng/fast-dev-cli"
@@ -1,3 +1,4 @@
1
+ import os
1
2
  import subprocess
2
3
  from contextlib import redirect_stdout
3
4
  from io import StringIO
@@ -168,3 +169,15 @@ def test_bump_with_emoji(mocker, tmp_path, monkeypatch):
168
169
  out = capture_cmd_output(["git", "log"])
169
170
  new_commit = "⬆️ Bump version: 0.1.0 → 0.1.1"
170
171
  assert new_commit in out
172
+
173
+
174
+ def test_bump_with_uv(tmp_path):
175
+ project_dir = tmp_path / "helloworld"
176
+ project_dir.mkdir()
177
+ with chdir(project_dir):
178
+ subprocess.run(["uv", "init"])
179
+ command = BumpUp(part="patch", commit=False).gen()
180
+ assert "pyproject.toml" in command
181
+ Path(TOML_FILE).write_text("[project]" + os.linesep + 'version = "0.1.0"')
182
+ command = BumpUp(part="patch", commit=True).gen()
183
+ assert TOML_FILE in command
@@ -1 +0,0 @@
1
- __version__ = "0.11.2"
File without changes
File without changes