Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • caosdb/src/caosdb-pylib
1 result
Show changes
Commits on Source (2)
* caosdb-server >= 0.8.0
* caosdb-server >= 0.12.0
* Python >= 3.8
* pip >= 20.0.2
......
......@@ -4,6 +4,7 @@
#
"""linkahead"""
import os
import re
import subprocess
import sys
......@@ -96,6 +97,7 @@ def get_version_info():
FULLVERSION = VERSION
# Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic.
GIT_REVISION = "Unknown"
if os.path.exists('.git'):
GIT_REVISION = git_version()
elif os.path.exists('linkahead_pylib_commit'):
......@@ -103,14 +105,13 @@ def get_version_info():
GIT_REVISION = f.read().strip()
elif os.path.exists('src/linkahead/version.py'):
# must be a source distribution, use existing version file
try:
from linkahead.version import git_revision as GIT_REVISION
except ImportError:
raise ImportError("Unable to import git_revision. Try removing "
"src/linkahead/version.py and the build directory "
"before building.")
else:
GIT_REVISION = "Unknown"
with open('src/linkahead/version.py') as fi:
rev_pattern = re.compile(r"^git_revision = '(?P<rev>.*)'$")
for line in fi.readlines():
match = rev_pattern.match(line)
if match is not None:
GIT_REVISION = match.group('rev')
break
if not ISRELEASED:
FULLVERSION += '.dev0+' + GIT_REVISION[:7]
......