pre_commit_mirror_maker_2 1.10.0.1__tar.gz → 1.10.0.3__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.
Files changed (23) hide show
  1. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/PKG-INFO +5 -2
  2. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/README.md +4 -1
  3. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml +1 -0
  4. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/main.py +18 -0
  5. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/make_repo.py +20 -2
  6. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/PKG-INFO +5 -2
  7. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/setup.cfg +1 -1
  8. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/LICENSE +0 -0
  9. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/__init__.py +0 -0
  10. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/all/.version +0 -0
  11. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/languages.py +0 -0
  12. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/node/.npmignore +0 -0
  13. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/node/package.json +0 -0
  14. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/python/setup.py +0 -0
  15. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/ruby/pre_commit_fake_gem.gemspec +0 -0
  16. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/rust/Cargo.toml +0 -0
  17. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker/rust/main.rs +0 -0
  18. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/SOURCES.txt +0 -0
  19. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/dependency_links.txt +0 -0
  20. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/entry_points.txt +0 -0
  21. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/requires.txt +0 -0
  22. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/pre_commit_mirror_maker_2.egg-info/top_level.txt +0 -0
  23. {pre_commit_mirror_maker_2-1.10.0.1 → pre_commit_mirror_maker_2-1.10.0.3}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre_commit_mirror_maker_2
3
- Version: 1.10.0.1
3
+ Version: 1.10.0.3
4
4
  Summary: Fork of pre-commit-mirror-maker
5
5
  Home-page: https://github.com/GideonBear/pre-commit-mirror-maker-2
6
6
  Author: Anthony Sottile
@@ -26,8 +26,11 @@ pre-commit-mirror-maker-2
26
26
  Scripts for creating mirror repositories that do not have
27
27
  .pre-commit-hooks.yaml
28
28
 
29
- This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few features.
29
+ This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few
30
+ features, including:
30
31
 
32
+ * Adding support for `always_run: true` and `pass_filenames: false`
33
+ * Add `--skip-existing` which skips existing tags
31
34
 
32
35
  ### Installation
33
36
 
@@ -7,8 +7,11 @@ pre-commit-mirror-maker-2
7
7
  Scripts for creating mirror repositories that do not have
8
8
  .pre-commit-hooks.yaml
9
9
 
10
- This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few features.
10
+ This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few
11
+ features, including:
11
12
 
13
+ * Adding support for `always_run: true` and `pass_filenames: false`
14
+ * Add `--skip-existing` which skips existing tags
12
15
 
13
16
  ### Installation
14
17
 
@@ -6,5 +6,6 @@
6
6
  '{match_key}': {match_val}
7
7
  args: {args}
8
8
  require_serial: {require_serial}
9
+ pass_filenames: {pass_filenames}
9
10
  additional_dependencies: {additional_dependencies}
10
11
  minimum_pre_commit_version: {minimum_pre_commit_version!r}
@@ -33,6 +33,11 @@ def main(argv: Sequence[str] | None = None) -> int:
33
33
  'repo_path',
34
34
  help='Local path where the git repo is checked out.',
35
35
  )
36
+ parser.add_argument(
37
+ '--skip-existing', action='store_true',
38
+ help='Skip tagging versions for which a tag already exists. '
39
+ 'Useful for converting existing mirrors to use this tool.',
40
+ )
36
41
  parser.add_argument(
37
42
  '--language', required=True, choices=LIST_VERSIONS,
38
43
  help='Which language to use.',
@@ -53,6 +58,10 @@ def main(argv: Sequence[str] | None = None) -> int:
53
58
  mutex.add_argument(
54
59
  '--types-or', action='append', help='`identify` type to OR match',
55
60
  )
61
+ mutex.add_argument(
62
+ '--always-run', action='store_true',
63
+ help='Set `always_run: true` for the hook',
64
+ )
56
65
 
57
66
  parser.add_argument(
58
67
  '--id', help='Hook id, defaults to the entry point.',
@@ -73,6 +82,10 @@ def main(argv: Sequence[str] | None = None) -> int:
73
82
  '--require-serial', action='store_true',
74
83
  help='Set `require_serial: true` for the hook',
75
84
  )
85
+ parser.add_argument(
86
+ '--pass-filenames-false', action='store_true',
87
+ help='Set `pass_filesnames: false` for the hook',
88
+ )
76
89
  args = parser.parse_args(argv)
77
90
 
78
91
  minimum_pre_commit_version = '0'
@@ -84,6 +97,9 @@ def main(argv: Sequence[str] | None = None) -> int:
84
97
  elif args.types:
85
98
  match_key = 'types'
86
99
  match_val = f'[{args.types}]'
100
+ elif args.always_run:
101
+ match_key = 'always_run'
102
+ match_val = json.dumps(args.always_run)
87
103
  else:
88
104
  match_key = 'files'
89
105
  match_val = args.files_regex
@@ -98,6 +114,7 @@ def main(argv: Sequence[str] | None = None) -> int:
98
114
  make_repo(
99
115
  args.repo_path,
100
116
  name=args.package_name,
117
+ skip_existing=args.skip_existing,
101
118
  description=args.description,
102
119
  language=args.language,
103
120
  entry=args.entry or args.package_name,
@@ -106,6 +123,7 @@ def main(argv: Sequence[str] | None = None) -> int:
106
123
  match_val=match_val,
107
124
  args=json.dumps(split_by_commas(args.args)),
108
125
  require_serial=json.dumps(args.require_serial),
126
+ pass_filenames=json.dumps(not args.pass_filenames_false),
109
127
  minimum_pre_commit_version=minimum_pre_commit_version,
110
128
  )
111
129
  return 0
@@ -43,6 +43,7 @@ def _commit_version(
43
43
  repo: str, *,
44
44
  language: str,
45
45
  version: str,
46
+ skip_existing: bool,
46
47
  **fmt_vars: str,
47
48
  ) -> None:
48
49
  # 'all' writes the .version and .pre-commit-hooks.yaml files
@@ -68,10 +69,26 @@ def _commit_version(
68
69
  # Commit and tag
69
70
  git('add', '.')
70
71
  git('commit', '-m', f'Mirror: {version}')
71
- git('tag', f'v{version}')
72
+ try:
73
+ git('tag', f'v{version}')
74
+ except subprocess.CalledProcessError as err:
75
+ if err.returncode == 128 and skip_existing:
76
+ print(
77
+ f'Tag v{version} already exists, '
78
+ 'skipping tagging step due to --skip-existing',
79
+ )
80
+ else:
81
+ raise
72
82
 
73
83
 
74
- def make_repo(repo: str, *, language: str, name: str, **fmt_vars: str) -> None:
84
+ def make_repo(
85
+ repo: str,
86
+ *,
87
+ language: str,
88
+ name: str,
89
+ skip_existing: bool,
90
+ **fmt_vars: str,
91
+ ) -> None:
75
92
  assert os.path.exists(os.path.join(repo, '.git')), repo
76
93
 
77
94
  package_versions = LIST_VERSIONS[language](name)
@@ -97,6 +114,7 @@ def make_repo(repo: str, *, language: str, name: str, **fmt_vars: str) -> None:
97
114
  name=name,
98
115
  language=language,
99
116
  version=version,
117
+ skip_existing=skip_existing,
100
118
  additional_dependencies=json.dumps(additional_dependencies),
101
119
  **fmt_vars,
102
120
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre_commit_mirror_maker_2
3
- Version: 1.10.0.1
3
+ Version: 1.10.0.3
4
4
  Summary: Fork of pre-commit-mirror-maker
5
5
  Home-page: https://github.com/GideonBear/pre-commit-mirror-maker-2
6
6
  Author: Anthony Sottile
@@ -26,8 +26,11 @@ pre-commit-mirror-maker-2
26
26
  Scripts for creating mirror repositories that do not have
27
27
  .pre-commit-hooks.yaml
28
28
 
29
- This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few features.
29
+ This is a fork of [pre-commit-mirror-maker](https://github.com/pre-commit/pre-commit-mirror-maker) to add a few
30
+ features, including:
30
31
 
32
+ * Adding support for `always_run: true` and `pass_filenames: false`
33
+ * Add `--skip-existing` which skips existing tags
31
34
 
32
35
  ### Installation
33
36
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pre_commit_mirror_maker_2
3
- version = 1.10.0.1
3
+ version = 1.10.0.3
4
4
  description = Fork of pre-commit-mirror-maker
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown