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

MAINT: do not import linkahead during build

parent 276252fd
No related branches found
No related tags found
1 merge request!123TEST: xfail for issue 111
Pipeline #42061 passed
......@@ -4,6 +4,7 @@
#
"""linkahead"""
import os
import re
import subprocess
import sys
......@@ -103,12 +104,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.")
with open('src/linkahead/version.py') as fi:
for line in fi.readlines():
match = re.match(r"^git_revision = (?P<rev>.*)$", line)
if match is not None:
GIT_REVISION = match.group('rev')
else:
GIT_REVISION = "Unknown"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment