Skip to content
Snippets Groups Projects
Commit 2248fc54 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: do not import linkahead during build

parent aa250ad5
No related branches found
No related tags found
No related merge requests found
Pipeline #44874 failed
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
"""linkahead""" """linkahead"""
import os import os
import re
import subprocess import subprocess
import sys import sys
...@@ -96,6 +97,7 @@ def get_version_info(): ...@@ -96,6 +97,7 @@ def get_version_info():
FULLVERSION = VERSION FULLVERSION = VERSION
# Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic. # Magic which is only really needed in the pipelines. Therefore: a lot of dark pipeline magic.
GIT_REVISION = "Unknown"
if os.path.exists('.git'): if os.path.exists('.git'):
GIT_REVISION = git_version() GIT_REVISION = git_version()
elif os.path.exists('linkahead_pylib_commit'): elif os.path.exists('linkahead_pylib_commit'):
...@@ -103,14 +105,13 @@ def get_version_info(): ...@@ -103,14 +105,13 @@ def get_version_info():
GIT_REVISION = f.read().strip() GIT_REVISION = f.read().strip()
elif os.path.exists('src/linkahead/version.py'): elif os.path.exists('src/linkahead/version.py'):
# must be a source distribution, use existing version file # must be a source distribution, use existing version file
try: with open('src/linkahead/version.py') as fi:
from linkahead.version import git_revision as GIT_REVISION rev_pattern = re.compile(r"^git_revision = '(?P<rev>.*)'$")
except ImportError: for line in fi.readlines():
raise ImportError("Unable to import git_revision. Try removing " match = rev_pattern.match(line)
"src/linkahead/version.py and the build directory " if match is not None:
"before building.") GIT_REVISION = match.group('rev')
else: break
GIT_REVISION = "Unknown"
if not ISRELEASED: if not ISRELEASED:
FULLVERSION += '.dev0+' + GIT_REVISION[:7] FULLVERSION += '.dev0+' + GIT_REVISION[:7]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment