Make version PEP 440 compliant

This commit is contained in:
grossmj 2022-11-06 17:51:31 +08:00
parent f3b8f43689
commit 9cf2e4f5a6

View File

@ -23,7 +23,7 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
__version__ = "2.2.35dev1"
__version__ = "2.2.35.dev2"
__version_info__ = (2, 2, 35, 99)
if "dev" in __version__:
@ -31,7 +31,7 @@ if "dev" in __version__:
import os
import subprocess
if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".git")):
r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode().strip()
__version__ = "{}-{}".format(__version__, r)
r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).decode().strip("\n")
__version__ += "+" + r
except Exception as e:
print(e)