mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
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:
parent
a131b1a9e6
commit
824dedad76
3 changed files with 4654 additions and 5 deletions
File diff suppressed because it is too large
Load diff
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue