sync-pre-commit-deps 0.0.4__tar.gz → 0.0.5__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.
- {sync_pre_commit_deps-0.0.4/sync_pre_commit_deps.egg-info → sync_pre_commit_deps-0.0.5}/PKG-INFO +2 -2
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/README.md +1 -1
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/setup.cfg +1 -1
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5/sync_pre_commit_deps.egg-info}/PKG-INFO +2 -2
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.py +18 -5
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/LICENSE +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/setup.py +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/SOURCES.txt +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/dependency_links.txt +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/entry_points.txt +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/requires.txt +0 -0
- {sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/top_level.txt +0 -0
{sync_pre_commit_deps-0.0.4/sync_pre_commit_deps.egg-info → sync_pre_commit_deps-0.0.5}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sync_pre_commit_deps
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Sync pre-commit hook dependencies based on other installed hooks
|
|
5
5
|
Home-page: https://github.com/pre-commit/sync-pre-commit-deps
|
|
6
6
|
Author: Max R
|
|
@@ -35,7 +35,7 @@ Sample `.pre-commit-config.yaml`:
|
|
|
35
35
|
|
|
36
36
|
```yaml
|
|
37
37
|
- repo: https://github.com/pre-commit/sync-pre-commit-deps
|
|
38
|
-
rev: v0.0.
|
|
38
|
+
rev: v0.0.5
|
|
39
39
|
hooks:
|
|
40
40
|
- id: sync-pre-commit-deps
|
|
41
41
|
```
|
{sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5/sync_pre_commit_deps.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sync_pre_commit_deps
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Sync pre-commit hook dependencies based on other installed hooks
|
|
5
5
|
Home-page: https://github.com/pre-commit/sync-pre-commit-deps
|
|
6
6
|
Author: Max R
|
|
@@ -35,7 +35,7 @@ Sample `.pre-commit-config.yaml`:
|
|
|
35
35
|
|
|
36
36
|
```yaml
|
|
37
37
|
- repo: https://github.com/pre-commit/sync-pre-commit-deps
|
|
38
|
-
rev: v0.0.
|
|
38
|
+
rev: v0.0.5
|
|
39
39
|
hooks:
|
|
40
40
|
- id: sync-pre-commit-deps
|
|
41
41
|
```
|
|
@@ -20,6 +20,23 @@ SUPPORTED = {
|
|
|
20
20
|
|
|
21
21
|
_SEPS = ('==', '@')
|
|
22
22
|
_RE_SEP = re.compile(rf'^(.+)({"|".join(_SEPS)})(.+)$')
|
|
23
|
+
_RE_FROZEN = re.compile(r'#\s*frozen:\s*(\S+)')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _version(repo: ruamel.yaml.comments.CommentedMap) -> str:
|
|
27
|
+
tokens = repo.ca.items.get('rev') or ()
|
|
28
|
+
for token in tokens:
|
|
29
|
+
if token and (match := _RE_FROZEN.search(token.value)):
|
|
30
|
+
rev = match.group(1)
|
|
31
|
+
break
|
|
32
|
+
else:
|
|
33
|
+
rev = repo['rev']
|
|
34
|
+
|
|
35
|
+
# `mirrors-mypy` and various node revs have a 'v' prefix,
|
|
36
|
+
# so we have to strip that out to get the
|
|
37
|
+
# additional_dependency version.
|
|
38
|
+
return rev.removeprefix('v')
|
|
39
|
+
|
|
23
40
|
|
|
24
41
|
_ARGUMENT_HELP_TEMPLATE = (
|
|
25
42
|
'The `{}` argument to the YAML dumper. '
|
|
@@ -69,11 +86,7 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
69
86
|
if repo['repo'] not in ('local', 'meta'):
|
|
70
87
|
for hook in repo['hooks']:
|
|
71
88
|
if (dep := SUPPORTED.get(hook['id'])) is not None:
|
|
72
|
-
|
|
73
|
-
# so we have to strip that out to get the
|
|
74
|
-
# additional_dependency version.
|
|
75
|
-
cleaned_rev = repo['rev'].removeprefix('v')
|
|
76
|
-
versions[dep] = cleaned_rev
|
|
89
|
+
versions[dep] = _version(repo)
|
|
77
90
|
|
|
78
91
|
updated = []
|
|
79
92
|
for repo in loaded['repos']:
|
|
File without changes
|
|
File without changes
|
{sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sync_pre_commit_deps-0.0.4 → sync_pre_commit_deps-0.0.5}/sync_pre_commit_deps.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|