From 0c8397e940ebec0d7a975f0f6526923affdf5aa3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 13 Jul 2016 19:29:41 -0700 Subject: [PATCH] core: Better VERSION handling (closes #279) --- .gitignore | 2 +- VERSION | 1 + __init__.py | 1 - setup.py | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 VERSION delete mode 100644 __init__.py diff --git a/.gitignore b/.gitignore index 040f57c..ad83af9 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..ea5e9d3 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.9-beta1 diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e2c1666..0000000 --- a/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.9-beta1' diff --git a/setup.py b/setup.py index 8961eec..6bc7665 100644 --- a/setup.py +++ b/setup.py @@ -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