1
0
Fork 0

Merge pull request #2033 from Salamandar/fix_version_number

Fix version numbering in source autoupdating (remove leading v)
This commit is contained in:
Tagada 2024-02-17 19:10:31 +01:00 committed by GitHub
commit 41e2e1894e

View file

@ -250,13 +250,16 @@ class AppAutoUpdater:
def apply_version_regex(tag: str) -> Optional[str]: def apply_version_regex(tag: str) -> Optional[str]:
# First preprocessing according to the manifest version_regex… # First preprocessing according to the manifest version_regex…
if not version_regex: if version_regex:
return tag match = re.match(version_regex, tag)
match = re.match(version_regex, tag) if match is None:
if match is None: return None
return None # Basically: either groupdict if named capture gorups, sorted by names, or groups()
# Basically: either groupdict if named capture gorups, sorted by names, or groups() tag = ".".join(dict(sorted(match.groupdict().items())).values() or match.groups())
return ".".join(dict(sorted(match.groupdict().items())).values() or match.groups())
# Then remove leading v
tag = tag.lstrip("v")
return tag
def version_numbers(tag: str) -> Optional[tuple[int, ...]]: def version_numbers(tag: str) -> Optional[tuple[int, ...]]:
filter_keywords = ["start", "rc", "beta", "alpha"] filter_keywords = ["start", "rc", "beta", "alpha"]