Support new miniconda file name format

This commit is contained in:
Alex Hedges 2023-01-03 20:29:19 -05:00
parent b3a5b5eee3
commit e715e03be0

View file

@ -121,7 +121,7 @@ class PyVersion(StrEnum):
@total_ordering @total_ordering
class VersionStr(str): class VersionStr(str):
def info(self): def info(self):
return tuple(int(n) for n in self.split(".")) return tuple(int(n) for n in self.replace("-", ".").split("."))
def __eq__(self, other): def __eq__(self, other):
return str(self) == str(other) return str(self) == str(other)
@ -214,7 +214,10 @@ class CondaSpec(NamedTuple):
@classmethod @classmethod
def from_filestem(cls, stem, md5, repo, py_version=None): def from_filestem(cls, stem, md5, repo, py_version=None):
miniconda_n, ver, os, arch = stem.split("-") # The `*vers` captures the new trailing `-1` in some file names (a build number?)
# so they can be processed properly.
miniconda_n, *vers, os, arch = stem.split("-")
ver = "-".join(vers)
suffix = miniconda_n[-1] suffix = miniconda_n[-1]
if suffix in string.digits: if suffix in string.digits:
tflavor = miniconda_n[:-1] tflavor = miniconda_n[:-1]
@ -372,7 +375,7 @@ if __name__ == "__main__":
reason = "already exists" reason = "already exists"
elif key.version_str.info() <= (4, 3, 30): elif key.version_str.info() <= (4, 3, 30):
reason = "too old" reason = "too old"
elif len(key.version_str.info()) >= 4: elif len(key.version_str.info()) >= 4 and "-" not in key.version_str:
reason = "ignoring hotfix releases" reason = "ignoring hotfix releases"
if reason: if reason: