Skip to content
Snippets Groups Projects
Commit d0242bf5 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

tweaks

parent adef4248
No related branches found
No related tags found
1 merge request!229Create exact git version information in setup.py
Pipeline #
......@@ -7,7 +7,7 @@ __version__ = '3.9.0'
def gitversion():
try:
from .git_version import get_gitversion
from .git_version import gitversion
except ImportError:
return "unknown"
return get_gitversion()
return gitversion
......@@ -18,18 +18,16 @@
from setuptools import setup, find_packages
exec(open('nifty4/version.py').read())
def write_version():
import subprocess
p = subprocess.Popen(["git", "describe", "--dirty"],
stdout=subprocess.PIPE)
res = p.communicate()[0].strip().decode('utf-8')
with open("nifty4/git_version.py", "w") as file:
file.write("def get_gitversion():\n")
file.write(' return "{}"\n'.format(res))
file.write('gitversion = "{}"\n'.format(res))
write_version()
exec(open('nifty4/version.py').read())
setup(name="nifty4",
version=__version__,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment