Skip to content

Commit 0a419f8

Browse files
author
Eugeniu Zaicanu
committed
Fallback to reading version from json file
1 parent 5e77f24 commit 0a419f8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ def read_version_tag():
6060

6161
return None
6262

63+
def read_version_from_json_file():
64+
with open(os.path.join(os.path.dirname(__file__), "pepper", "version.json")) as f:
65+
return json.load(f)['version']
66+
6367
def parse_version_tag(tag):
6468
'''
6569
Parse the output from Git describe
@@ -68,7 +72,7 @@ def parse_version_tag(tag):
6872
Git SHA (if available).
6973
'''
7074
if not tag or '-g' not in tag:
71-
return tag, None, None
75+
return read_version_from_json_file(), None, None
7276

7377
match = re.search('(?P<version>.*)-(?P<num_commits>[0-9]+)-g(?P<sha>[0-9a-fA-F]+)', tag)
7478

0 commit comments

Comments
 (0)