Retain old python-build-standalone releases (#8216)

Closes https://github.com/astral-sh/uv/issues/8213

I didn't mean to remove these when updating the regular expression.
Arguably, they shouldn't be used anymore, but we should make that choice
with intention.
This commit is contained in:
Zanie Blue 2024-10-15 11:08:46 -05:00 committed by GitHub
parent a131b1a9e6
commit 824dedad76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4654 additions and 5 deletions

File diff suppressed because it is too large Load diff

View file

@ -174,11 +174,24 @@ class CPythonFinder(Finder):
(?P<ver>\d+\.\d+\.\d+(?:(?:a|b|rc)\d+)?)(?:\+\d+)?\+
(?P<date>\d+)-
(?P<triple>[a-z\d_]+-[a-z\d]+(?>-[a-z\d]+)?-[a-z\d]+)-
(?>(?P<build_options>.+)-)?
(?P<flavor>.+)
(?:(?P<build_options>.+)-)?
(?P<flavor>[a-z_]+)?
\.tar\.(?:gz|zst)
$
"""
"""
)
_legacy_filename_re = re.compile(
r"""(?x)
^
cpython-
(?P<ver>\d+\.\d+\.\d+(?:(?:a|b|rc)\d+)?)(?:\+\d+)?-
(?P<triple>[a-z\d_-]+)-
(?P<build_options>(debug|pgo|noopt|lto|pgo\+lto))?-
(?P<date>[a-zA-z\d]+)
\.tar\.(?:gz|zst)
$
"""
)
def __init__(self, client: httpx.AsyncClient):
@ -296,12 +309,18 @@ class CPythonFinder(Finder):
return None
filename = unquote(url.rsplit("/", maxsplit=1)[-1])
match = self._filename_re.match(filename)
match = self._filename_re.match(filename) or self._legacy_filename_re.match(
filename
)
if match is None:
logging.debug("Skipping %s: no regex match", filename)
return None
version, _date, triple, build_options, flavor = match.groups()
groups = match.groupdict()
version = groups["ver"]
triple = groups["triple"]
build_options = groups.get("build_options")
flavor = groups.get("flavor", "full")
build_options = build_options.split("+") if build_options else []
variant: Variant | None

File diff suppressed because it is too large Load diff