3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-23 19:19:31 +01:00

core: Better VERSION handling (closes #279)

This commit is contained in:
James Lu 2016-07-13 19:29:41 -07:00
parent 88281a3a54
commit 0c8397e940
4 changed files with 4 additions and 3 deletions

2
.gitignore vendored
View File

@ -3,7 +3,7 @@
!example-*.yml
!.*.yml
# Ignore automatically generated version for normal commits. This is bumped manually when needed.
# Automatically generated by setup.py
__init__.py
env/

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.9-beta1

View File

@ -1 +0,0 @@
__version__ = '0.9-beta1'

View File

@ -10,8 +10,9 @@ try:
version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
except Exception as e:
print('ERROR: Failed to get version from "git describe --tags": %s: %s' % (type(e).__name__, e))
from __init__ import __version__ as fallback_version
with open('VERSION') as f:
fallback_version = f.read().strip()
print('Using fallback version of %r.' % fallback_version)
version = fallback_version