dycw-pre-commit-hooks 0.13.9__py3-none-any.whl → 0.13.22__py3-none-any.whl
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.
Potentially problematic release.
This version of dycw-pre-commit-hooks might be problematic. Click here for more details.
- {dycw_pre_commit_hooks-0.13.9.dist-info → dycw_pre_commit_hooks-0.13.22.dist-info}/METADATA +14 -13
- {dycw_pre_commit_hooks-0.13.9.dist-info → dycw_pre_commit_hooks-0.13.22.dist-info}/RECORD +10 -10
- dycw_pre_commit_hooks-0.13.22.dist-info/WHEEL +4 -0
- {dycw_pre_commit_hooks-0.13.9.dist-info → dycw_pre_commit_hooks-0.13.22.dist-info}/entry_points.txt +1 -0
- pre_commit_hooks/__init__.py +1 -1
- pre_commit_hooks/check_version_bumped/__init__.py +2 -0
- pre_commit_hooks/check_version_bumped/check-version-bumped +1 -1
- pre_commit_hooks/common.py +2 -2
- pre_commit_hooks/tag_commits/__init__.py +6 -2
- dycw_pre_commit_hooks-0.13.9.dist-info/WHEEL +0 -4
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: dycw-pre-commit-hooks
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.22
|
|
4
|
+
Author: Derek Wan
|
|
4
5
|
Author-email: Derek Wan <d.wan@icloud.com>
|
|
5
|
-
Requires-
|
|
6
|
-
Requires-Dist:
|
|
7
|
-
Requires-Dist:
|
|
8
|
-
Requires-Dist:
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
15
|
-
Requires-
|
|
6
|
+
Requires-Dist: click>=8.3.0,<8.4
|
|
7
|
+
Requires-Dist: dycw-utilities>=0.168.9,<0.169
|
|
8
|
+
Requires-Dist: gitpython>=3.1.45,<3.2
|
|
9
|
+
Requires-Dist: libcst>=1.8.5,<1.9
|
|
10
|
+
Requires-Dist: loguru>=0.7.3,<0.8
|
|
11
|
+
Requires-Dist: more-itertools>=10.8.0,<10.9
|
|
12
|
+
Requires-Dist: orjson>=3.11.3,<3.12
|
|
13
|
+
Requires-Dist: packaging>=25.0,<25.1
|
|
14
|
+
Requires-Dist: tomlkit>=0.13.3,<0.14
|
|
15
|
+
Requires-Dist: xdg-base-dirs>=6.0.2,<6.1
|
|
16
|
+
Requires-Python: >=3.13
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
|
|
18
19
|
# pre-commit-hooks
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
pre_commit_hooks/__init__.py,sha256=
|
|
2
|
-
pre_commit_hooks/common.py,sha256=ZClypoURLwURWBORPrsEeYYDwWNbRCTVjUwZMIYHNZE,4502
|
|
3
|
-
pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1
|
+
pre_commit_hooks/__init__.py,sha256=uHNGme-jaqjufA2L2VdQ9tvKclDHb6dOuHVHyvmO_fY,60
|
|
4
2
|
pre_commit_hooks/check_submodules_updated/__init__.py,sha256=j-NrV-_l_47meqcMz-QxIUOyWloI3coQXXDKg1Jhwgs,900
|
|
5
3
|
pre_commit_hooks/check_submodules_updated/__main__.py,sha256=_-uQnuopAJQiHgoSLRMekYrVBbO9-rjP2s9cCC0u3jQ,161
|
|
6
4
|
pre_commit_hooks/check_submodules_updated/check-submodules-updated,sha256=bgYJ4bUCcRr53HQ0_1pGK-zoWmYg1eEsAd02qJgcrQw,917
|
|
7
|
-
pre_commit_hooks/check_version_bumped/__init__.py,sha256=
|
|
5
|
+
pre_commit_hooks/check_version_bumped/__init__.py,sha256=RB9rGOxLumxu-LG6b2X5nVTdoMkrP0AlxwoJ5NbKgUU,845
|
|
8
6
|
pre_commit_hooks/check_version_bumped/__main__.py,sha256=ujl_2PmNW065bAKzVmJzgCYW70fxGy9hqtT-B0dhWok,157
|
|
9
|
-
pre_commit_hooks/check_version_bumped/check-version-bumped,sha256=
|
|
7
|
+
pre_commit_hooks/check_version_bumped/check-version-bumped,sha256=T3ULM9DKEyLHr04fNiSB_WC_wGqyFx_dgU17PABv6aY,1940
|
|
8
|
+
pre_commit_hooks/common.py,sha256=27TsXjLm3GVbbfwA96y4RLVXRQjq2YNm8nn_BhKpSpA,4406
|
|
10
9
|
pre_commit_hooks/format_requirements/__init__.py,sha256=ByGP9oCf5c5-55Tayp8BvnT6O-_Fi5om1AAva1BzLvg,3223
|
|
11
10
|
pre_commit_hooks/format_requirements/__main__.py,sha256=15JSp_rhjI_Ddoj4MRkHFShfnYxs6GggUhLRlGtrQ0E,156
|
|
12
11
|
pre_commit_hooks/mirror_files/__init__.py,sha256=GSoFXo_og3d7NkQcmzdWOZyxQJPCO1nr4JtMVVcNJOI,1646
|
|
13
12
|
pre_commit_hooks/mirror_files/__main__.py,sha256=YzOSNKR2XrVST5dgIVJrpRL28QkcziciOomuKtVX7Jo,149
|
|
13
|
+
pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
pre_commit_hooks/replace_sequence_str/__init__.py,sha256=IUyhpYh89PF9fX65zYe5Pt3cIvvWa0HiUDng0deL0Nw,1628
|
|
15
15
|
pre_commit_hooks/replace_sequence_str/__main__.py,sha256=B1dxOxngV4vUVnDVrXSywiySOs1P_zF30_4ZMRsOSaY,157
|
|
16
16
|
pre_commit_hooks/run_bump_my_version/__init__.py,sha256=FhvLQEEoFm21_2c_12Loy_lc8gfNv2wtwAOrdtBEqrs,2028
|
|
17
17
|
pre_commit_hooks/run_bump_my_version/__main__.py,sha256=w2V3y61jrSau-zxjl8ciHtWPlJQwXbYxNJ2tGYVyI4s,156
|
|
18
|
-
pre_commit_hooks/tag_commits/__init__.py,sha256=
|
|
18
|
+
pre_commit_hooks/tag_commits/__init__.py,sha256=_gr3jy9Yu8y-B1X3RbS6QLRSlAjEM_GlpILQCIEKX1Y,3614
|
|
19
19
|
pre_commit_hooks/tag_commits/__main__.py,sha256=qefgYw7LWbvmzZS45-ym6olS4cHqw1Emw2wlqZBXN_o,148
|
|
20
|
-
dycw_pre_commit_hooks-0.13.
|
|
21
|
-
dycw_pre_commit_hooks-0.13.
|
|
22
|
-
dycw_pre_commit_hooks-0.13.
|
|
23
|
-
dycw_pre_commit_hooks-0.13.
|
|
20
|
+
dycw_pre_commit_hooks-0.13.22.dist-info/WHEEL,sha256=M6du7VZflc4UPsGphmOXHANdgk8zessdJG0DBUuoA-U,78
|
|
21
|
+
dycw_pre_commit_hooks-0.13.22.dist-info/entry_points.txt,sha256=dinG7yn1efTb3DU-2UnHJ3t3Ig_qA9KMTHHfrOBJX6w,451
|
|
22
|
+
dycw_pre_commit_hooks-0.13.22.dist-info/METADATA,sha256=D6LiKxEIn4bKpjb3qr-QfDImkHWtZ2xgf0uLYnbti4o,1196
|
|
23
|
+
dycw_pre_commit_hooks-0.13.22.dist-info/RECORD,,
|
pre_commit_hooks/__init__.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from importlib.resources import files
|
|
4
|
+
from stat import S_IXUSR
|
|
4
5
|
from subprocess import SubprocessError, run
|
|
5
6
|
from typing import TYPE_CHECKING, cast
|
|
6
7
|
|
|
@@ -22,6 +23,7 @@ def _process() -> bool:
|
|
|
22
23
|
file = cast("Path", files("pre_commit_hooks")).joinpath(
|
|
23
24
|
"check_version_bumped", "check-version-bumped"
|
|
24
25
|
)
|
|
26
|
+
file.chmod(file.stat().st_mode | S_IXUSR)
|
|
25
27
|
try:
|
|
26
28
|
_ = run([str(file)], check=True)
|
|
27
29
|
except SubprocessError:
|
|
@@ -34,7 +34,7 @@ main() {
|
|
|
34
34
|
echo_date "'bump-my-version' or 'pip' must be available" >&2 && return 1
|
|
35
35
|
fi
|
|
36
36
|
if ! have_bump_my_version && have_command pip; then
|
|
37
|
-
pip install bump-my-version
|
|
37
|
+
pip install bump-my-version 'click >=8.2.1, <8.3'
|
|
38
38
|
fi
|
|
39
39
|
if ! have_bump_my_version; then
|
|
40
40
|
echo_date "'bump-my-version' must be available" >&2 && return 1
|
pre_commit_hooks/common.py
CHANGED
|
@@ -69,7 +69,7 @@ def get_version(source: Mode | Path | str | bytes | TOMLDocument, /) -> Version:
|
|
|
69
69
|
msg = f"`version` is not a string; got {get_class_name(version)!r}"
|
|
70
70
|
raise GetVersionError(msg)
|
|
71
71
|
return parse_version(version)
|
|
72
|
-
case never:
|
|
72
|
+
case never:
|
|
73
73
|
assert_never(never)
|
|
74
74
|
|
|
75
75
|
|
|
@@ -83,7 +83,7 @@ def get_toml_path(mode: Mode = DEFAULT_MODE, /) -> Path:
|
|
|
83
83
|
return Path("pyproject.toml")
|
|
84
84
|
case "bumpversion":
|
|
85
85
|
return Path(".bumpversion.toml")
|
|
86
|
-
case never:
|
|
86
|
+
case never:
|
|
87
87
|
assert_never(never)
|
|
88
88
|
|
|
89
89
|
|
|
@@ -102,7 +102,7 @@ def _tag_commit(
|
|
|
102
102
|
str_ver = str(version)
|
|
103
103
|
try:
|
|
104
104
|
existing = repo.tags[str_ver]
|
|
105
|
-
except
|
|
105
|
+
except IndexError:
|
|
106
106
|
pass
|
|
107
107
|
else:
|
|
108
108
|
repo.delete_tag(existing)
|
|
@@ -112,7 +112,11 @@ def _tag_commit(
|
|
|
112
112
|
msg = f"Failed to tag {desc}; error creating tag: {error.stderr.strip()}"
|
|
113
113
|
raise TagCommitsError(msg) from None
|
|
114
114
|
logger.info(f"Tagging {desc} as {str_ver!r}...")
|
|
115
|
-
|
|
115
|
+
try:
|
|
116
|
+
_ = repo.remotes.origin.push(f"refs/tags/{tag.name}")
|
|
117
|
+
except GitCommandError as error:
|
|
118
|
+
msg = f"Failed to tag {desc}; error pushing tag: {error.stderr.strip()}"
|
|
119
|
+
raise TagCommitsError(msg) from None
|
|
116
120
|
return True
|
|
117
121
|
|
|
118
122
|
|