Commit 9cd2baba authored by Lukas Platz's avatar Lukas Platz
Browse files

unbreak setup without git in path

If there is no `git` executable in the path of the installing shell,
the setup will fail because the `setup.py` `write_version` function will
raise a `FileNotFoundError` exception.
parent 609ba005
......@@ -20,9 +20,13 @@ from setuptools import find_packages, setup
def write_version():
import subprocess
p = subprocess.Popen(["git", "describe", "--dirty", "--tags", "--always"],
stdout=subprocess.PIPE)
res = p.communicate()[0].strip().decode('utf-8')
try:
p = subprocess.Popen(["git", "describe", "--dirty", "--tags", "--always"],
stdout=subprocess.PIPE)
res = p.communicate()[0].strip().decode('utf-8')
except FileNotFoundError:
print("Could not determine version string from git history")
res = "unknown"
with open("nifty7/git_version.py", "w") as file:
file.write('gitversion = "{}"\n'.format(res))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment