From c36080d82c61934014690799a0c9ceb55d4c0750 Mon Sep 17 00:00:00 2001 From: Hayden Metsky Date: Tue, 31 Oct 2023 22:40:03 -0400 Subject: [PATCH] Fix setuptools version error A change to setuptools requires conformant version formats; see https://github.com/pypa/setuptools/issues/3772. CATCH could not be installed with `pip install` using newer versions of setuptools. --- catch/utils/version.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/catch/utils/version.py b/catch/utils/version.py index c8154374..0a43ceea 100644 --- a/catch/utils/version.py +++ b/catch/utils/version.py @@ -10,7 +10,7 @@ """ # Manually specify a numbered release version to use as a fallback -RELEASE_VERSION = 'v1.5.1' +RELEASE_VERSION = '1.5.1' import subprocess @@ -57,6 +57,12 @@ def get_version_from_git_describe(): if not isinstance(out, str): out = out.decode('utf-8') ver = out.strip() + if ver.startswith("v"): + ver = ver[1:] + if "-" in ver: + ver_release, ver_local = ver.split("-", 1) + ver_local = ver_local.replace("-", ".") + ver = ver_release + "+" + ver_local except Exception: ver = None os.chdir(cwd)