pre_commit_mirror_maker_2 1.12.0.1__tar.gz → 1.14.0.1__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 (26) hide show
  1. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/PKG-INFO +2 -2
  2. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml +1 -1
  3. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/languages.py +40 -5
  4. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/make_repo.py +2 -0
  5. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/PKG-INFO +2 -2
  6. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/setup.cfg +2 -2
  7. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/LICENSE +0 -0
  8. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/README.md +0 -0
  9. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/__init__.py +0 -0
  10. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/all/.version +0 -0
  11. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/golang/go.mod +0 -0
  12. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/golang/go.sum +0 -0
  13. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/golang/main.go +0 -0
  14. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/main.py +0 -0
  15. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/node/.npmignore +0 -0
  16. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/node/package.json +0 -0
  17. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/python/setup.py +0 -0
  18. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/ruby/pre_commit_fake_gem.gemspec +0 -0
  19. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/rust/Cargo.toml +0 -0
  20. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker/rust/main.rs +0 -0
  21. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/SOURCES.txt +0 -0
  22. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/dependency_links.txt +0 -0
  23. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/entry_points.txt +0 -0
  24. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/requires.txt +0 -0
  25. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/pre_commit_mirror_maker_2.egg-info/top_level.txt +0 -0
  26. {pre_commit_mirror_maker_2-1.12.0.1 → pre_commit_mirror_maker_2-1.14.0.1}/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.12.0.1
3
+ Version: 1.14.0.1
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
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Programming Language :: Python :: Implementation :: CPython
15
15
  Classifier: Programming Language :: Python :: Implementation :: PyPy
16
- Requires-Python: >=3.10
16
+ Requires-Python: >=3.11
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: packaging
@@ -1,5 +1,5 @@
1
1
  - id: {id}
2
- name: {name}
2
+ name: {name!r}
3
3
  description: {description!r}
4
4
  entry: {entry}
5
5
  language: {language}
@@ -1,8 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
+ import os
4
5
  import re
5
6
  import subprocess
7
+ import urllib.error
6
8
  import urllib.request
7
9
 
8
10
  from packaging import requirements
@@ -34,6 +36,16 @@ def rust_get_package_versions(package_name: str) -> list[str]:
34
36
  return list(reversed([version['num'] for version in resp['versions']]))
35
37
 
36
38
 
39
+ def haskell_get_package_versions(package_name: str) -> list[str]:
40
+ url = f'https://hackage.haskell.org/package/{package_name}/preferred.json'
41
+ resp = json.load(urllib.request.urlopen(url))
42
+ versions = {
43
+ *resp.get('normal-version', ()),
44
+ *resp.get('deprecated-version', ()),
45
+ }
46
+ return sorted(versions, key=version.parse)
47
+
48
+
37
49
  def golang_get_package_versions(package_name: str) -> list[str]:
38
50
  # https://pkg.go.dev/golang.org/x/mod/module#EscapePath
39
51
  # https://github.com/golang/mod/blob/d271cf332fd221d661d13b186b51a11d7e66ff74/module/module.go#L707
@@ -41,11 +53,26 @@ def golang_get_package_versions(package_name: str) -> list[str]:
41
53
  r'[A-Z]',
42
54
  lambda m: f'!{m.group(0).lower()}', package_name,
43
55
  )
44
- url = f'https://proxy.golang.org/{escaped}/@v/list'
45
- resp = urllib.request.urlopen(url).read().decode()
46
- return sorted(
47
- (v.removeprefix('v') for v in resp.splitlines()),
48
- key=version.parse,
56
+
57
+ # Greedily choose the longest non-404 path
58
+ # (based on https://go.dev/ref/mod#resolve-pkg-mod)
59
+ while escaped:
60
+ url = f'https://proxy.golang.org/{escaped}/@v/list'
61
+ try:
62
+ resp = urllib.request.urlopen(url).read().decode()
63
+ except urllib.error.HTTPError as exc:
64
+ if exc.code == 404:
65
+ escaped = os.path.dirname(escaped)
66
+ continue
67
+ raise
68
+
69
+ return sorted(
70
+ (v.removeprefix('v') for v in resp.splitlines()),
71
+ key=version.parse,
72
+ )
73
+
74
+ raise ValueError(
75
+ f'Cannot find package name {package_name} on proxy.golang.org',
49
76
  )
50
77
 
51
78
 
@@ -61,6 +88,12 @@ def rust_get_additional_dependencies(
61
88
  return [f'cli:{package_name}:{package_version}']
62
89
 
63
90
 
91
+ def haskell_get_additional_dependencies(
92
+ package_name: str, package_version: str,
93
+ ) -> list[str]:
94
+ return [f'{package_name}-{package_version}']
95
+
96
+
64
97
  def golang_get_additional_dependencies(
65
98
  package_name: str, package_version: str,
66
99
  ) -> list[str]:
@@ -69,6 +102,7 @@ def golang_get_additional_dependencies(
69
102
 
70
103
  LIST_VERSIONS = {
71
104
  'golang': golang_get_package_versions,
105
+ 'haskell': haskell_get_package_versions,
72
106
  'node': node_get_package_versions,
73
107
  'python': python_get_package_versions,
74
108
  'ruby': ruby_get_package_versions,
@@ -77,6 +111,7 @@ LIST_VERSIONS = {
77
111
 
78
112
  ADDITIONAL_DEPENDENCIES = {
79
113
  'golang': golang_get_additional_dependencies,
114
+ 'haskell': haskell_get_additional_dependencies,
80
115
  'node': node_get_additional_dependencies,
81
116
  'rust': rust_get_additional_dependencies,
82
117
  }
@@ -51,6 +51,8 @@ def _commit_version(
51
51
  with importlib.resources.as_file(files) as files_p:
52
52
  for lang in ('all', language):
53
53
  src = files_p.joinpath(lang)
54
+ if not os.path.exists(src):
55
+ continue
54
56
  format_files(
55
57
  src,
56
58
  repo,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre_commit_mirror_maker_2
3
- Version: 1.12.0.1
3
+ Version: 1.14.0.1
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
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Classifier: Programming Language :: Python :: Implementation :: CPython
15
15
  Classifier: Programming Language :: Python :: Implementation :: PyPy
16
- Requires-Python: >=3.10
16
+ Requires-Python: >=3.11
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
19
  Requires-Dist: packaging
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pre_commit_mirror_maker_2
3
- version = 1.12.0.1
3
+ version = 1.14.0.1
4
4
  description = Fork of pre-commit-mirror-maker
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -22,7 +22,7 @@ classifiers =
22
22
  packages = find:
23
23
  install_requires =
24
24
  packaging
25
- python_requires = >=3.10
25
+ python_requires = >=3.11
26
26
 
27
27
  [options.packages.find]
28
28
  exclude =