From 0a419f8f46e08f2d6eb0653c96b7986ae1073d98 Mon Sep 17 00:00:00 2001 From: Eugeniu Zaicanu Date: Fri, 6 Nov 2015 22:15:06 +0100 Subject: [PATCH] Fallback to reading version from json file --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2d02dce..5f2d007 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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.*)-(?P[0-9]+)-g(?P[0-9a-fA-F]+)', tag)