diff --git a/version.py b/version.py index e053bffd..3f71d1a6 100644 --- a/version.py +++ b/version.py @@ -1,36 +1,36 @@ -import os -import subprocess -from sys import stdout +# import os +# import subprocess +# from sys import stdout -try: - with open(os.devnull, 'w') as devnull: - v = subprocess.check_output(['git', 'describe', '--dirty', '--abbrev'], stderr=stdout).decode().strip() - print(v) - if '-' in v: - bv = v[:v.index('-')] - bv = bv[:bv.rindex('.') + 1] + str(int(bv[bv.rindex('.') + 1:]) + 1) - sempre = 'dirty' if v.endswith('-dirty') else 'commit' - pippre = 'alpha' if v.endswith('-dirty') else 'pre' - build = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode().strip() - number_since = subprocess.check_output( - ['git', 'rev-list', v[:v.index('-')] + '..HEAD', '--count']).decode().strip() - semver = bv + '-' + sempre + '+' + build - pipver = bv + pippre + number_since - winver = v[:v.index('-')] + '.' + number_since - else: - semver = v - pipver = v - winver = v + '.0' +# try: +# with open(os.devnull, 'w') as devnull: +# v = subprocess.check_output(['git', 'describe', '--dirty', '--abbrev'], stderr=stdout).decode().strip() +# print(v) +# if '-' in v: +# bv = v[:v.index('-')] +# bv = bv[:bv.rindex('.') + 1] + str(int(bv[bv.rindex('.') + 1:]) + 1) +# sempre = 'dirty' if v.endswith('-dirty') else 'commit' +# pippre = 'alpha' if v.endswith('-dirty') else 'pre' +# build = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode().strip() +# number_since = subprocess.check_output( +# ['git', 'rev-list', v[:v.index('-')] + '..HEAD', '--count']).decode().strip() +# semver = bv + '-' + sempre + '+' + build +# pipver = bv + pippre + number_since +# winver = v[:v.index('-')] + '.' + number_since +# else: +# semver = v +# pipver = v +# winver = v + '.0' - with open('version', 'w') as f: - print('Semantic version is ' + semver) - f.write(semver) - with open('pip_version', 'w') as f: - print('PIP version is ' + pipver) - f.write(pipver) - with open('win_version', 'w') as f: - print('Windows version is ' + winver) - f.write(winver) -except Exception as e: - print('Error calling git') - print(e) +# with open('version', 'w') as f: +# print('Semantic version is ' + semver) +# f.write(semver) +# with open('pip_version', 'w') as f: +# print('PIP version is ' + pipver) +# f.write(pipver) +# with open('win_version', 'w') as f: +# print('Windows version is ' + winver) +# f.write(winver) +# except Exception as e: +# print('Error calling git') +# print(e)