Skip to content

Commit

Permalink
comment out version.py as a temp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
noam987 authored and ayushuk committed Dec 29, 2023
1 parent 96324bd commit f4b1312
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions version.py
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)

0 comments on commit f4b1312

Please sign in to comment.