summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 470dd774..04aae5b2 100644
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,13 @@ def in_virtualenv():
def get_version():
cmd = [sys.executable, "tools/read-version"]
ver = subprocess.check_output(cmd)
- return ver.decode("utf-8").strip()
+ version = ver.decode("utf-8").strip()
+ # read-version can spit out something like 22.4-15-g7f97aee24
+ # which is invalid under PEP440. If we replace the first - with a +
+ # that should give us a valid version.
+ if "-" in version:
+ version = version.replace("-", "+", 1)
+ return version
def read_requires():