3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

setup: reword fallback version format & warnings

Also, change the suffix from -dirty to -nogit.

(cherry picked from commit a4e1f2a4ab)
This commit is contained in:
James Lu 2016-10-14 21:29:36 -07:00
parent 8bffffa000
commit 9e6e30324f

View File

@ -19,8 +19,9 @@ with open('VERSION', encoding='utf-8') as f:
try: try:
real_version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip() real_version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
except Exception as e: except Exception as e:
print('ERROR: Failed to get Git version from "git describe --tags": %s: %s' % (type(e).__name__, e)) print('WARNING: Failed to get Git version from "git describe --tags": %s: %s' % (type(e).__name__, e))
real_version = version + '-dirty' print("If you're installing from PyPI or a tarball, ignore the above message.")
real_version = version + '-nogit'
# Write the version to disk. # Write the version to disk.
with open('__init__.py', 'w') as f: with open('__init__.py', 'w') as f: