fast-dev-cli 0.16.1__tar.gz → 0.16.2__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.
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/PKG-INFO +1 -1
- fast_dev_cli-0.16.2/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/fast_dev_cli/cli.py +15 -2
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/pyproject.toml +47 -9
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_bump.py +7 -3
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_tag.py +5 -3
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_upgrade.py +2 -2
- fast_dev_cli-0.16.1/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/LICENSE +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/README.md +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/fast_dev_cli/py.typed +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/pdm_build.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/scripts/check.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/scripts/format.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/scripts/test.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/__init__.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/conftest.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_fast_test.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_functions.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_lint.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_poetry_version_plugin.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_runserver.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_sync.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_upload.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/test_version.py +0 -0
- {fast_dev_cli-0.16.1 → fast_dev_cli-0.16.2}/tests/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.16.2"
|
|
@@ -413,6 +413,8 @@ class BumpUp(DryRun):
|
|
|
413
413
|
cmd += " && git push && git push --tags && git log -1"
|
|
414
414
|
else:
|
|
415
415
|
cmd += " --allow-dirty"
|
|
416
|
+
if Project.is_pdm_project():
|
|
417
|
+
cmd = "pdm sync --prod && " + cmd
|
|
416
418
|
return cmd
|
|
417
419
|
|
|
418
420
|
def run(self: Self) -> None:
|
|
@@ -528,6 +530,15 @@ class Project:
|
|
|
528
530
|
root = venv_parent
|
|
529
531
|
return root
|
|
530
532
|
|
|
533
|
+
@classmethod
|
|
534
|
+
def is_pdm_project(cls, strict: bool = True) -> bool:
|
|
535
|
+
if cls.get_manage_tool() != "pdm":
|
|
536
|
+
return False
|
|
537
|
+
if strict:
|
|
538
|
+
lock_file = cls.get_work_dir() / "pdm.lock"
|
|
539
|
+
return lock_file.exists()
|
|
540
|
+
return True
|
|
541
|
+
|
|
531
542
|
|
|
532
543
|
class ParseError(Exception):
|
|
533
544
|
"""Raise this if parse dependence line error"""
|
|
@@ -704,9 +715,9 @@ class UpgradeDependencies(Project, DryRun):
|
|
|
704
715
|
|
|
705
716
|
def gen(self: Self) -> str:
|
|
706
717
|
if self._tool == "uv":
|
|
707
|
-
return "uv lock --upgrade --verbose && uv sync --frozen"
|
|
718
|
+
return "uv lock --upgrade --verbose && uv sync --frozen --all-groups"
|
|
708
719
|
elif self._tool == "pdm":
|
|
709
|
-
return "pdm update --verbose && pdm
|
|
720
|
+
return "pdm update --verbose && pdm sync -G :all"
|
|
710
721
|
return self.gen_cmd() + " && poetry lock && poetry update"
|
|
711
722
|
|
|
712
723
|
|
|
@@ -745,6 +756,8 @@ class GitTag(DryRun):
|
|
|
745
756
|
cmd = f"git tag -a {_version} -m {self.message!r} && git push --tags"
|
|
746
757
|
if self.should_push():
|
|
747
758
|
cmd += " && git push"
|
|
759
|
+
if Project.is_pdm_project():
|
|
760
|
+
cmd = "pdm sync --prod && " + cmd
|
|
748
761
|
return cmd
|
|
749
762
|
|
|
750
763
|
@cached_property
|
|
@@ -42,7 +42,7 @@ dependencies = [
|
|
|
42
42
|
"bumpversion2 >=1.4.3,<2",
|
|
43
43
|
"pytest >=8.2.0,<9",
|
|
44
44
|
]
|
|
45
|
-
version = "0.16.
|
|
45
|
+
version = "0.16.2"
|
|
46
46
|
|
|
47
47
|
[project.urls]
|
|
48
48
|
Homepage = "https://github.com/waketzheng/fast-dev-cli"
|
|
@@ -55,6 +55,11 @@ include-optional-dependencies = [
|
|
|
55
55
|
[project.scripts]
|
|
56
56
|
fast = "fast_dev_cli:cli.main"
|
|
57
57
|
|
|
58
|
+
[dependency-groups]
|
|
59
|
+
dev = [
|
|
60
|
+
"twine>=6.1.0",
|
|
61
|
+
]
|
|
62
|
+
|
|
58
63
|
[tool.pdm]
|
|
59
64
|
distribution = true
|
|
60
65
|
|
|
@@ -72,6 +77,46 @@ dev = [
|
|
|
72
77
|
"-e file:///${PROJECT_ROOT}/#egg=fast-dev-cli[all]",
|
|
73
78
|
]
|
|
74
79
|
|
|
80
|
+
[tool.pdm.scripts]
|
|
81
|
+
test = "pdm run fast test"
|
|
82
|
+
check = "pdm run fast check {args}"
|
|
83
|
+
lint = "pdm run fast lint {args}"
|
|
84
|
+
deps = "pdm sync -G :all {args}"
|
|
85
|
+
prod = "pdm install --prod --frozen"
|
|
86
|
+
tree = "pdm list --tree"
|
|
87
|
+
update_self_version = "pdm sync"
|
|
88
|
+
|
|
89
|
+
[tool.pdm.scripts.style]
|
|
90
|
+
composite = [
|
|
91
|
+
"ruff format",
|
|
92
|
+
"ruff check --fix {args}",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[tool.pdm.scripts.bump]
|
|
96
|
+
composite = [
|
|
97
|
+
"update_self_version",
|
|
98
|
+
"pdm run fast bump patch --commit {args}",
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
[tool.pdm.scripts.tag]
|
|
102
|
+
composite = [
|
|
103
|
+
"update_self_version",
|
|
104
|
+
"pdm run fast tag {args}",
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
[tool.pdm.scripts.start]
|
|
108
|
+
composite = [
|
|
109
|
+
"pre-commit install",
|
|
110
|
+
"deps",
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
[tool.pdm.scripts.ci]
|
|
114
|
+
composite = [
|
|
115
|
+
"deps",
|
|
116
|
+
"check",
|
|
117
|
+
"test",
|
|
118
|
+
]
|
|
119
|
+
|
|
75
120
|
[tool.waketzheng._internal-slim-build.packages.fastdevcli-slim.project]
|
|
76
121
|
name = "fastdevcli-slim"
|
|
77
122
|
|
|
@@ -155,6 +200,7 @@ extend-select = [
|
|
|
155
200
|
]
|
|
156
201
|
"fast_dev_cli/cli.py" = [
|
|
157
202
|
"UP007",
|
|
203
|
+
"UP045",
|
|
158
204
|
]
|
|
159
205
|
|
|
160
206
|
[tool.bandit]
|
|
@@ -164,11 +210,3 @@ exclude_dirs = [
|
|
|
164
210
|
"examples",
|
|
165
211
|
".venv",
|
|
166
212
|
]
|
|
167
|
-
|
|
168
|
-
[dependency-groups]
|
|
169
|
-
ci = [
|
|
170
|
-
"coveralls @ git+https://github.com/waketzheng/coveralls-python@4.1.1",
|
|
171
|
-
]
|
|
172
|
-
dev = [
|
|
173
|
-
"twine>=6.1.0",
|
|
174
|
-
]
|
|
@@ -39,12 +39,14 @@ def test_enum():
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def _bump_commands(
|
|
42
|
-
version: str, filename=TOML_FILE, emoji=False
|
|
42
|
+
version: str, filename=TOML_FILE, emoji=False, add_sync=True
|
|
43
43
|
) -> tuple[str, str, str]:
|
|
44
44
|
cmd = rf'bumpversion --parse "(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)" --current-version="{version}"'
|
|
45
45
|
suffix = " --commit && git push && git push --tags && git log -1"
|
|
46
46
|
if emoji:
|
|
47
47
|
suffix = suffix.replace("--commit", "--commit --message-emoji=1")
|
|
48
|
+
if add_sync:
|
|
49
|
+
cmd = "pdm sync --prod && " + cmd
|
|
48
50
|
patch_without_commit = cmd + f" patch {filename} --allow-dirty"
|
|
49
51
|
patch_with_commit = cmd + f" patch {filename}" + suffix
|
|
50
52
|
minor_with_commit = cmd + f" minor {filename} --tag" + suffix
|
|
@@ -99,7 +101,9 @@ def test_bump(
|
|
|
99
101
|
def test_bump_with_poetry(mocker, tmp_poetry_project, tmp_path):
|
|
100
102
|
mocker.patch("builtins.input", return_value=" ")
|
|
101
103
|
version = get_current_version()
|
|
102
|
-
patch_without_commit, patch_with_commit, minor_with_commit = _bump_commands(
|
|
104
|
+
patch_without_commit, patch_with_commit, minor_with_commit = _bump_commands(
|
|
105
|
+
version, add_sync=False
|
|
106
|
+
)
|
|
103
107
|
stream = StringIO()
|
|
104
108
|
with redirect_stdout(stream):
|
|
105
109
|
BumpUp(part="patch", commit=False).run()
|
|
@@ -167,7 +171,7 @@ def test_bump_with_emoji(mocker, tmp_path, monkeypatch):
|
|
|
167
171
|
def test_bump_with_emoji_in_poetry_project(mocker, tmp_path, monkeypatch):
|
|
168
172
|
# real bump
|
|
169
173
|
last_commit = "📝 Update release notes"
|
|
170
|
-
_, patch_with_commit, __ = _bump_commands("0.1.0", emoji=True)
|
|
174
|
+
_, patch_with_commit, __ = _bump_commands("0.1.0", emoji=True, add_sync=False)
|
|
171
175
|
with prepare_poetry_project(tmp_path):
|
|
172
176
|
subprocess.run(["git", "init"])
|
|
173
177
|
subprocess.run(["git", "add", "."])
|
|
@@ -52,12 +52,14 @@ def test_with_push(mocker):
|
|
|
52
52
|
mocker.patch.object(git_tag, "git_status", return_value="git push")
|
|
53
53
|
version = get_current_version()
|
|
54
54
|
prefix = "v" if "v" in capture_cmd_output(["git", "tag"]) else ""
|
|
55
|
-
|
|
55
|
+
sync = "pdm sync --prod"
|
|
56
|
+
push = "git push --tags"
|
|
57
|
+
assert git_tag.gen() == f"{sync} && git tag -a {prefix}{version} -m '' && {push}"
|
|
56
58
|
with _clear_tags():
|
|
57
59
|
git_tag_cmd = git_tag.gen()
|
|
58
|
-
assert git_tag_cmd == f"git tag -a {version} -m '' &&
|
|
60
|
+
assert git_tag_cmd == f"{sync} && git tag -a {version} -m '' && {push}"
|
|
59
61
|
mocker.patch.object(git_tag, "has_v_prefix", return_value=True)
|
|
60
|
-
tag_cmd = f"git tag -a v{version} -m '' &&
|
|
62
|
+
tag_cmd = f"{sync} && git tag -a v{version} -m '' && {push}"
|
|
61
63
|
assert git_tag.gen() == tag_cmd
|
|
62
64
|
mocker.patch.object(git_tag, "should_push", return_value=True)
|
|
63
65
|
assert git_tag.gen() == tag_cmd + " && git push"
|
|
@@ -292,7 +292,7 @@ fastapi = "^0.112.2"
|
|
|
292
292
|
|
|
293
293
|
def test_upgrade_uv_project():
|
|
294
294
|
cmd = "fast upgrade --tool=uv --dry"
|
|
295
|
-
expected = "uv lock --upgrade --verbose && uv sync --frozen"
|
|
295
|
+
expected = "uv lock --upgrade --verbose && uv sync --frozen --all-groups"
|
|
296
296
|
assert expected in capture_cmd_output(cmd)
|
|
297
297
|
assert expected in capture_cmd_output("pdm run " + cmd)
|
|
298
298
|
assert UpgradeDependencies(tool="uv").gen() == expected
|
|
@@ -300,7 +300,7 @@ def test_upgrade_uv_project():
|
|
|
300
300
|
|
|
301
301
|
def test_upgrade_pdm_project():
|
|
302
302
|
cmd = "fast upgrade --tool=pdm --dry"
|
|
303
|
-
expected = "pdm update --verbose && pdm
|
|
303
|
+
expected = "pdm update --verbose && pdm sync -G :all"
|
|
304
304
|
assert expected in capture_cmd_output(cmd)
|
|
305
305
|
assert expected in capture_cmd_output("pdm run " + cmd)
|
|
306
306
|
assert UpgradeDependencies(tool="pdm").gen() == expected
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.16.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|