Skip to content

Commit a6fa6b8

Browse files
committed
fix version retrieval
1 parent ca2dd10 commit a6fa6b8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main():
2626
EXTRA_REQUIRES,
2727
)
2828

29-
pkg_data = {'templateflow': [
29+
pkg_data = {__packagename__: [
3030
'conf/config.json',
3131
'conf/templateflow-skel.zip'
3232
]}

templateflow/_version.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,19 @@ def get_versions():
495495
# versionfile_source is the relative path from the top of the source
496496
# tree (where the .git directory might live) to this file. Invert
497497
# this to find the root from __file__.
498+
root_dir = os.path.dirname(root)
499+
if os.path.isfile(os.path.join(root_dir, 'VERSION')):
500+
with open(os.path.join(root_dir, 'VERSION')) as vfile:
501+
version = vfile.readline().strip()
502+
503+
return {
504+
"version": version,
505+
"full-revisionid": None,
506+
"dirty": None,
507+
"error": None,
508+
"date": None
509+
}
510+
498511
for i in cfg.versionfile_source.split('/'):
499512
root = os.path.dirname(root)
500513
except NameError:

0 commit comments

Comments
 (0)