pre_commit_mirror_maker_2 1.12.0.0__tar.gz → 1.13.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.
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/PKG-INFO +1 -1
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/languages.py +22 -5
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/PKG-INFO +1 -1
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/setup.cfg +1 -1
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/LICENSE +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/README.md +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/__init__.py +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/all/.pre-commit-hooks.yaml +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/all/.version +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/golang/go.mod +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/golang/go.sum +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/golang/main.go +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/main.py +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/make_repo.py +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/node/.npmignore +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/node/package.json +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/python/setup.py +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/ruby/pre_commit_fake_gem.gemspec +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/rust/Cargo.toml +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker/rust/main.rs +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/SOURCES.txt +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/dependency_links.txt +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/entry_points.txt +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/requires.txt +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/pre_commit_mirror_maker_2.egg-info/top_level.txt +0 -0
- {pre_commit_mirror_maker_2-1.12.0.0 → pre_commit_mirror_maker_2-1.13.0.1}/setup.py +0 -0
|
@@ -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
|
|
@@ -41,11 +43,26 @@ def golang_get_package_versions(package_name: str) -> list[str]:
|
|
|
41
43
|
r'[A-Z]',
|
|
42
44
|
lambda m: f'!{m.group(0).lower()}', package_name,
|
|
43
45
|
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
|
|
47
|
+
# Greedily choose the longest non-404 path
|
|
48
|
+
# (based on https://go.dev/ref/mod#resolve-pkg-mod)
|
|
49
|
+
while escaped:
|
|
50
|
+
url = f'https://proxy.golang.org/{escaped}/@v/list'
|
|
51
|
+
try:
|
|
52
|
+
resp = urllib.request.urlopen(url).read().decode()
|
|
53
|
+
except urllib.error.HTTPError as exc:
|
|
54
|
+
if exc.code == 404:
|
|
55
|
+
escaped = os.path.dirname(escaped)
|
|
56
|
+
continue
|
|
57
|
+
raise
|
|
58
|
+
|
|
59
|
+
return sorted(
|
|
60
|
+
(v.removeprefix('v') for v in resp.splitlines()),
|
|
61
|
+
key=version.parse,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
raise ValueError(
|
|
65
|
+
f'Cannot find package name {package_name} on proxy.golang.org',
|
|
49
66
|
)
|
|
50
67
|
|
|
51
68
|
|
|
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
|
|
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
|