dycw-pre-commit-hooks 0.12.5__tar.gz → 0.12.6__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.
Potentially problematic release.
This version of dycw-pre-commit-hooks might be problematic. Click here for more details.
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/PKG-INFO +2 -1
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/pyproject.toml +4 -2
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/__init__.py +1 -1
- dycw_pre_commit_hooks-0.12.6/src/pre_commit_hooks/mirror_files/__init__.py +36 -0
- dycw_pre_commit_hooks-0.12.6/src/pre_commit_hooks/mirror_files/__main__.py +6 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/.gitignore +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/README.md +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/check_submodules/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/check_submodules/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/common.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/format_requirements/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/format_requirements/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/py.typed +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/replace_sequence_str/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/replace_sequence_str/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/run_bump_my_version/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/run_bump_my_version/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/tag_commits/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/tag_commits/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/in.toml +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/out.toml +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/test_format_requirements.py +0 -0
- {dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/test_main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dycw-pre-commit-hooks
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.6
|
|
4
4
|
Author-email: Derek Wan <d.wan@icloud.com>
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: click<8.3,>=8.2.1
|
|
@@ -8,6 +8,7 @@ Requires-Dist: dycw-utilities<0.167,>=0.166.5
|
|
|
8
8
|
Requires-Dist: gitpython<3.2,>=3.1.45
|
|
9
9
|
Requires-Dist: libcst<1.9,>=1.8.2
|
|
10
10
|
Requires-Dist: loguru<0.8,>=0.7.3
|
|
11
|
+
Requires-Dist: more-itertools<10.8,>=10.7.0
|
|
11
12
|
Requires-Dist: orjson<3.12,>=3.11.3
|
|
12
13
|
Requires-Dist: packaging<25.1,>=25.0
|
|
13
14
|
Requires-Dist: tomlkit<0.14,>=0.13.2
|
|
@@ -22,6 +22,7 @@ dependencies = [
|
|
|
22
22
|
"gitpython >=3.1.45, <3.2",
|
|
23
23
|
"libcst >=1.8.2, <1.9",
|
|
24
24
|
"loguru >=0.7.3, <0.8",
|
|
25
|
+
"more-itertools >=10.7.0, <10.8",
|
|
25
26
|
"orjson >=3.11.3, <3.12",
|
|
26
27
|
"packaging >=25.0, <25.1",
|
|
27
28
|
"tomlkit >=0.13.2, <0.14",
|
|
@@ -30,11 +31,12 @@ dependencies = [
|
|
|
30
31
|
name = "dycw-pre-commit-hooks"
|
|
31
32
|
readme = "README.md"
|
|
32
33
|
requires-python = ">= 3.12"
|
|
33
|
-
version = "0.12.
|
|
34
|
+
version = "0.12.6"
|
|
34
35
|
|
|
35
36
|
[project.scripts]
|
|
36
37
|
check-submodules = "pre_commit_hooks.check_submodules:main"
|
|
37
38
|
format-requirements = "pre_commit_hooks.format_requirements:main"
|
|
39
|
+
mirror-files = "pre_commit_hooks.mirror_files:main"
|
|
38
40
|
replace-sequence-str = "pre_commit_hooks.replace_sequence_str:main"
|
|
39
41
|
run-bump-my-version = "pre_commit_hooks.run_bump_my_version:main"
|
|
40
42
|
tag-commits = "pre_commit_hooks.tag_commits:main"
|
|
@@ -42,7 +44,7 @@ tag-commits = "pre_commit_hooks.tag_commits:main"
|
|
|
42
44
|
# bump-my-version
|
|
43
45
|
[tool.bumpversion]
|
|
44
46
|
allow_dirty = true
|
|
45
|
-
current_version = "0.12.
|
|
47
|
+
current_version = "0.12.6"
|
|
46
48
|
|
|
47
49
|
[[tool.bumpversion.files]]
|
|
48
50
|
filename = "src/pre_commit_hooks/__init__.py"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import utilities.click
|
|
6
|
+
from click import argument, command
|
|
7
|
+
from loguru import logger
|
|
8
|
+
from more_itertools import chunked
|
|
9
|
+
from utilities.atomicwrites import writer
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@command()
|
|
16
|
+
@argument("paths", nargs=-1, type=utilities.click.Path())
|
|
17
|
+
def main(*, paths: tuple[Path, ...]) -> bool:
|
|
18
|
+
"""CLI for the `format-requirements` hook."""
|
|
19
|
+
if len(paths) % 2 == 1:
|
|
20
|
+
logger.exception(f"Expected an even number of paths; got {len(paths)}")
|
|
21
|
+
raise RuntimeError
|
|
22
|
+
results = list(map(_process, chunked(paths, 2, strict=True))) # run all
|
|
23
|
+
return all(results)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _process(paths: list[Path], /) -> bool:
|
|
27
|
+
text_from, text_to = [p.read_text() for p in paths]
|
|
28
|
+
if text_from == text_to:
|
|
29
|
+
return True
|
|
30
|
+
_, path_to = paths
|
|
31
|
+
with writer(path_to, overwrite=True) as temp:
|
|
32
|
+
_ = temp.write_text(text_from)
|
|
33
|
+
return False
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
__all__ = ["main"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/pre_commit_hooks/common.py
RENAMED
|
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
|
{dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/in.toml
RENAMED
|
File without changes
|
{dycw_pre_commit_hooks-0.12.5 → dycw_pre_commit_hooks-0.12.6}/src/tests/format_requirements/out.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|