X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d9aa5decc6edce30285df049277de2cf2c138c26..a8ebe9f478e897334af0fcda79704de77c4dcea6:/sdk/python/setup_header.py diff --git a/sdk/python/setup_header.py b/sdk/python/setup_header.py index c97f94d5b6..21b950057c 100644 --- a/sdk/python/setup_header.py +++ b/sdk/python/setup_header.py @@ -1,9 +1,17 @@ import shutil import os import sys +import re -with os.popen("git log --format=format:%ct.%h -n1 .") as m: - minor_version=m.read() +if os.path.exists("PKG-INFO"): + with open("PKG-INFO", "r") as p: + for l in p: + g = re.match(r'Version: (.*)', l) + if g != None: + minor_version = g.group(1) +else: + with os.popen("git log --format=format:%ct.%h -n1 .") as m: + minor_version = m.read() # setup.py and setup_fuse.py both share the build/ directory (argh!) so # make sure to delete it to avoid scooping up the wrong files.