fast-dev-cli 0.9.8__tar.gz → 0.9.10__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.9.8 → fast_dev_cli-0.9.10}/PKG-INFO +2 -2
- fast_dev_cli-0.9.10/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/fast_dev_cli/cli.py +6 -3
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/pyproject.toml +2 -2
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_bump.py +24 -5
- fast_dev_cli-0.9.8/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/LICENSE +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/README.md +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/fast_dev_cli/py.typed +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/pdm_build.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/scripts/check.sh +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/scripts/format.sh +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/scripts/test.sh +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/__init__.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/conftest.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_fast_test.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_functions.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_lint.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_poetry_version_plugin.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_runserver.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_sync.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_tag.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_upgrade.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_upload.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/test_version.py +0 -0
- {fast_dev_cli-0.9.8 → fast_dev_cli-0.9.10}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fast-dev-cli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.10
|
|
4
4
|
Summary: Python project development tool.
|
|
5
5
|
Author-Email: Waket Zheng <waketzheng@gmail.com>>
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -21,13 +21,13 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
21
21
|
Project-URL: Homepage, https://github.com/waketzheng/fast-dev-cli
|
|
22
22
|
Requires-Python: <4,>=3.10
|
|
23
23
|
Requires-Dist: typer<0.13,>=0.12.3
|
|
24
|
+
Requires-Dist: emoji<3,>=2.12.1
|
|
24
25
|
Requires-Dist: tomli<3,>=2.0.1; python_version < "3.11"
|
|
25
26
|
Requires-Dist: coverage<8,>=7.5.1
|
|
26
27
|
Requires-Dist: ruff<0.7,>=0.4.4
|
|
27
28
|
Requires-Dist: mypy<2,>=1.10.0
|
|
28
29
|
Requires-Dist: bumpversion2<2,>=1.4.2
|
|
29
30
|
Requires-Dist: pytest<9,>=8.2.0
|
|
30
|
-
Requires-Dist: emoji<3,>=2.12.1
|
|
31
31
|
Requires-Dist: ipython<9,>=8.24.0; extra == "all"
|
|
32
32
|
Requires-Dist: pytest-mock<4,>=3.14.0; extra == "all"
|
|
33
33
|
Provides-Extra: all
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.9.10"
|
|
@@ -228,8 +228,9 @@ class BumpUp(DryRun):
|
|
|
228
228
|
cmd += " --tag"
|
|
229
229
|
cmd += " --commit"
|
|
230
230
|
if self.should_add_emoji():
|
|
231
|
-
cmd += " --
|
|
232
|
-
|
|
231
|
+
cmd += " --message-emoji=1"
|
|
232
|
+
if not load_bool("DONT_GIT_PUSH"):
|
|
233
|
+
cmd += " && git push && git push --tags && git log -1"
|
|
233
234
|
else:
|
|
234
235
|
cmd += " --allow-dirty"
|
|
235
236
|
return cmd
|
|
@@ -543,7 +544,9 @@ class GitTag(DryRun):
|
|
|
543
544
|
return capture_cmd_output("git status")
|
|
544
545
|
|
|
545
546
|
def mark_tag(self: Self) -> bool:
|
|
546
|
-
if not re.search(r"working (tree|directory) clean", self.git_status)
|
|
547
|
+
if not re.search(r"working (tree|directory) clean", self.git_status) and (
|
|
548
|
+
"无文件要提交,干净的工作区" not in self.git_status
|
|
549
|
+
):
|
|
547
550
|
run_and_echo("git status")
|
|
548
551
|
echo("ERROR: Please run git commit to make sure working tree is clean!")
|
|
549
552
|
return False
|
|
@@ -32,15 +32,15 @@ classifiers = [
|
|
|
32
32
|
]
|
|
33
33
|
dependencies = [
|
|
34
34
|
"typer>=0.12.3,<0.13",
|
|
35
|
+
"emoji >=2.12.1,<3",
|
|
35
36
|
"tomli>=2.0.1,<3; python_version < '3.11'",
|
|
36
37
|
"coverage >=7.5.1,<8",
|
|
37
38
|
"ruff >=0.4.4,<0.7",
|
|
38
39
|
"mypy >=1.10.0,<2",
|
|
39
40
|
"bumpversion2 >=1.4.2,<2",
|
|
40
41
|
"pytest >=8.2.0,<9",
|
|
41
|
-
"emoji >=2.12.1,<3",
|
|
42
42
|
]
|
|
43
|
-
version = "0.9.
|
|
43
|
+
version = "0.9.10"
|
|
44
44
|
|
|
45
45
|
[project.urls]
|
|
46
46
|
Homepage = "https://github.com/waketzheng/fast-dev-cli"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import subprocess
|
|
1
2
|
from contextlib import redirect_stdout
|
|
2
3
|
from io import StringIO
|
|
3
4
|
from pathlib import Path
|
|
@@ -14,11 +15,11 @@ from fast_dev_cli.cli import (
|
|
|
14
15
|
StrEnum,
|
|
15
16
|
bump,
|
|
16
17
|
bump_version,
|
|
18
|
+
capture_cmd_output,
|
|
17
19
|
get_current_version,
|
|
18
20
|
)
|
|
19
|
-
from tests.utils import mock_sys_argv
|
|
20
21
|
|
|
21
|
-
from .utils import chdir
|
|
22
|
+
from .utils import chdir, mock_sys_argv
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
def test_enum():
|
|
@@ -40,7 +41,7 @@ def _bump_commands(
|
|
|
40
41
|
cmd = rf'bumpversion --parse "(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)" --current-version="{version}"'
|
|
41
42
|
suffix = " --commit && git push && git push --tags && git log -1"
|
|
42
43
|
if emoji:
|
|
43
|
-
suffix = suffix.replace("--commit", "--commit --
|
|
44
|
+
suffix = suffix.replace("--commit", "--commit --message-emoji=1")
|
|
44
45
|
patch_without_commit = cmd + f" patch {filename} --allow-dirty"
|
|
45
46
|
patch_with_commit = cmd + f" patch {filename}" + suffix
|
|
46
47
|
minor_with_commit = cmd + f" minor {filename} --tag" + suffix
|
|
@@ -136,16 +137,34 @@ def test_bump_with_poetry(mocker, tmp_poetry_project, tmp_path):
|
|
|
136
137
|
assert work_dir == work_dir2 == tmp_path
|
|
137
138
|
|
|
138
139
|
|
|
139
|
-
def test_bump_with_emoji(mocker):
|
|
140
|
+
def test_bump_with_emoji(mocker, tmp_path, monkeypatch):
|
|
140
141
|
mocker.patch("fast_dev_cli.cli.Project.manage_by_poetry", return_value=True)
|
|
141
142
|
version = get_current_version()
|
|
142
143
|
patch_without_commit, patch_with_commit, minor_with_commit = _bump_commands(
|
|
143
144
|
version, emoji=True
|
|
144
145
|
)
|
|
146
|
+
last_commit = "📝 Update release notes"
|
|
145
147
|
mocker.patch(
|
|
146
148
|
"fast_dev_cli.cli.BumpUp.get_last_commit_message",
|
|
147
|
-
return_value=
|
|
149
|
+
return_value=last_commit,
|
|
148
150
|
)
|
|
149
151
|
assert BumpUp(part="patch", commit=False, dry=True).gen() == patch_without_commit
|
|
150
152
|
assert BumpUp(part="patch", commit=True, dry=True).gen() == patch_with_commit
|
|
151
153
|
assert BumpUp(part="minor", commit=True, dry=True).gen() == minor_with_commit
|
|
154
|
+
# real bump
|
|
155
|
+
with chdir(tmp_path):
|
|
156
|
+
project = "foo"
|
|
157
|
+
subprocess.run(["poetry", "new", project])
|
|
158
|
+
with chdir(tmp_path / project):
|
|
159
|
+
subprocess.run(["git", "init"])
|
|
160
|
+
subprocess.run(["git", "add", "."])
|
|
161
|
+
subprocess.run(["git", "commit", "-m", last_commit])
|
|
162
|
+
monkeypatch.setenv("DONT_GIT_PUSH", "1")
|
|
163
|
+
command = BumpUp(part="patch", commit=True).gen()
|
|
164
|
+
expected = patch_with_commit.split("&&")[0].strip().replace('""', '"0.1.0"')
|
|
165
|
+
assert expected == command
|
|
166
|
+
subprocess.run(["poetry", "run", "pip", "install", "bumpversion2"])
|
|
167
|
+
subprocess.run(["fast", "bump", "patch", "--commit"])
|
|
168
|
+
out = capture_cmd_output(["git", "log"])
|
|
169
|
+
new_commit = "⬆️ Bump version: 0.1.0 → 0.1.1"
|
|
170
|
+
assert new_commit in out
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.9.8"
|
|
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
|
|
File without changes
|
|
File without changes
|