Commit d516b4cd authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'versiontest' into 'NIFTy_4'

Create exact git version information in setup.py

See merge request ift/NIFTy!229
parents c81c1a88 97f39b09
Pipeline #25830 passed with stages
in 9 minutes and 56 seconds
# custom # never store the git version file
git_version.py
# custom
setup.cfg setup.cfg
.idea .idea
.DS_Store .DS_Store
......
...@@ -82,9 +82,9 @@ author = u'Theo Steininger / Martin Reinecke' ...@@ -82,9 +82,9 @@ author = u'Theo Steininger / Martin Reinecke'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = u'3.9' version = u'4.0'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = u'3.9.0' release = u'4.0.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
...@@ -2,4 +2,13 @@ ...@@ -2,4 +2,13 @@
# 1) we don't load dependencies by storing it in __init__.py # 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason # 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module # 3) we can import it into your module module
__version__ = '3.9.0'
__version__ = '4.0.0'
def gitversion():
try:
from .git_version import gitversion
except ImportError:
return "unknown"
return gitversion
...@@ -18,6 +18,17 @@ ...@@ -18,6 +18,17 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
def write_version():
import subprocess
p = subprocess.Popen(["git", "describe", "--dirty", "--tags"],
stdout=subprocess.PIPE)
res = p.communicate()[0].strip().decode('utf-8')
with open("nifty4/git_version.py", "w") as file:
file.write('gitversion = "{}"\n'.format(res))
write_version()
exec(open('nifty4/version.py').read()) exec(open('nifty4/version.py').read())
setup(name="nifty4", setup(name="nifty4",
......
Markdown is supported
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