diff --git a/setup.py b/setup.py index f7e06a7a..7b6cce27 100755 --- a/setup.py +++ b/setup.py @@ -33,13 +33,13 @@ def gitinfo(): from subprocess import Popen, PIPE, check_output kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) - proc = Popen(['git', 'describe', '--tags', '--match=v[[:digit:]]*'], **kw) + proc = Popen(['git', 'describe', '--tags', '--match=[v,V,[:digit:]]*'], **kw) desc = proc.stdout.read() proc = Popen(['git', 'log', '-1', '--format=%H %ct %ci'], **kw) glog = proc.stdout.read() rv = {} rv['commit'], rv['timestamp'], rv['date'] = glog.strip().split(None, 2) - version = check_output(['git', 'tag']).decode('ascii').strip() + version = '.post'.join(desc.strip().split('-')[:2]).lstrip('vV') rv['version'] = version return rv @@ -56,7 +56,7 @@ def getversioncfg(): cp0.read(gitarchivecfgfile) if len(cp0.get('DEFAULT', 'commit')) > 20: g = cp0.defaults() - mx = re.search(r'\btag: v(\d[^,]*)', g.pop('refnames')) + mx = re.search(r'\btag: [vV]?(\d[^,]*)', g.pop('refnames')) if mx: g['version'] = mx.group(1) # then try to obtain version data from git.