Skip to content

Commit

Permalink
Merge pull request #61 from EugeniuZ/master
Browse files Browse the repository at this point in the history
Fallback to reading version from json file
  • Loading branch information
whiteinge committed Nov 6, 2015
2 parents 5e77f24 + 0a419f8 commit de2baa5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def read_version_tag():

return None

def read_version_from_json_file():
with open(os.path.join(os.path.dirname(__file__), "pepper", "version.json")) as f:
return json.load(f)['version']

def parse_version_tag(tag):
'''
Parse the output from Git describe
Expand All @@ -68,7 +72,7 @@ def parse_version_tag(tag):
Git SHA (if available).
'''
if not tag or '-g' not in tag:
return tag, None, None
return read_version_from_json_file(), None, None

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

Expand Down

0 comments on commit de2baa5

Please sign in to comment.