Skip to content

Commit 1985464

Browse files
committed
FIX: Reinsert hack for docker image versions
1 parent cde8f56 commit 1985464

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

niworkflows/_version.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,22 @@ def get_versions():
628628
except NotThisMethod:
629629
pass
630630

631+
root = os.path.realpath(__file__)
632+
633+
root_dir = os.path.dirname(root)
634+
if os.path.isfile(os.path.join(root_dir, 'VERSION')):
635+
with open(os.path.join(root_dir, 'VERSION')) as vfile:
636+
version = vfile.readline().strip()
637+
638+
return {
639+
"version": version,
640+
"full-revisionid": None,
641+
"dirty": None,
642+
"error": None,
643+
"date": None
644+
}
645+
631646
try:
632-
root = os.path.realpath(__file__)
633647
# versionfile_source is the relative path from the top of the source
634648
# tree (where the .git directory might live) to this file. Invert
635649
# this to find the root from __file__.

0 commit comments

Comments
 (0)