-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comment out version.py as a temp fix
- Loading branch information
Showing
1 changed file
with
34 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |