From 73645562c7761230cb3858903e898571aa4ffbfb Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 15 Oct 2023 15:17:49 -0400 Subject: [PATCH 1/2] Update setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f7e06a7a..144005d6 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ 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() @@ -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. From 70236cb19632c50f592720d843d6b9f17eaa43c3 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:45:59 -0400 Subject: [PATCH 2/2] Fix version tagging --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 144005d6..7b6cce27 100755 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ def gitinfo(): 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