Commit 0eff4f8e authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'unbreak_setup_missing_git' into 'NIFTy_7'

Unbreak setup when no `git` exectuable in path

See merge request !617
parents 609ba005 9cd2baba
Pipeline #101657 passed with stages
in 26 minutes and 34 seconds
...@@ -20,9 +20,13 @@ from setuptools import find_packages, setup ...@@ -20,9 +20,13 @@ from setuptools import find_packages, setup
def write_version(): def write_version():
import subprocess import subprocess
p = subprocess.Popen(["git", "describe", "--dirty", "--tags", "--always"], try:
stdout=subprocess.PIPE) p = subprocess.Popen(["git", "describe", "--dirty", "--tags", "--always"],
res = p.communicate()[0].strip().decode('utf-8') 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: with open("nifty7/git_version.py", "w") as file:
file.write('gitversion = "{}"\n'.format(res)) 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