From def7b6dc93a2f94a284e8263011934706071bc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 25 Dec 2022 12:56:30 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20update=5Fextensions.py:=C2=A0version.pars?= =?UTF-8?q?e=20now=20fails=20on=20'master'=20version=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update_extensions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_extensions.py b/.github/workflows/update_extensions.py index 627c9a8..9f4de1c 100755 --- a/.github/workflows/update_extensions.py +++ b/.github/workflows/update_extensions.py @@ -62,11 +62,15 @@ def get_all_extensions() -> List[str]: def find_valid_ext(all_exts: List[str], name: str, max_version: version.Version) -> Optional[str]: def version_of(ext): - return version.parse(ext.split("-")[1].replace("_", ".").replace("REL", "")) + try: + return version.parse(ext.split("-")[1].replace("_", ".").replace("REL", "")) + except version.InvalidVersion: + print(f"Invalid version (this might be normal): {ext}") + return version.parse("0.0") found_exts = [ ext for ext in all_exts - if ext.startswith(name) and version_of(ext) <= max_version + if ext.startswith(name) and version_of(ext) <= max_version ] return max(found_exts, key=version_of) if found_exts else None