Skip to content

Commit

Permalink
Fix setuptools version error
Browse files Browse the repository at this point in the history
A change to setuptools requires conformant version formats; see
pypa/setuptools#3772. CATCH could not
be installed with `pip install` using newer versions of setuptools.
  • Loading branch information
haydenm committed Nov 1, 2023
1 parent 9c4696c commit c36080d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion catch/utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c36080d

Please sign in to comment.