diff --git a/qmpy/VERSION.txt b/qmpy/VERSION.txt new file mode 100644 index 00000000..26aaba0e --- /dev/null +++ b/qmpy/VERSION.txt @@ -0,0 +1 @@ +1.2.0 diff --git a/qmpy/__init__.py b/qmpy/__init__.py index 115bd5a1..f272a984 100644 --- a/qmpy/__init__.py +++ b/qmpy/__init__.py @@ -18,8 +18,12 @@ import django.core.exceptions as de -__version__ = '1.2.0' + +with open(os.path.join(os.path.dirname(__file__), 'VERSION.txt')) as fr: + __version__ = fr.read().strip() VERSION = __version__ +__short_version__ = __version__.rpartition('.')[0] + INSTALL_PATH = os.path.abspath(os.path.dirname(__file__)) sys.path = [os.path.join(INSTALL_PATH, 'qmpy', 'db')] + sys.path diff --git a/setup.py b/setup.py index 6caee604..072dc1c2 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,12 @@ +import os from setuptools import setup, find_packages -from qmpy import __version__ - +with open(os.path.join(os.path.dirname(__file__), 'qmpy', 'VERSION.txt')) as fr: + version = fr.read().strip() setup( name='qmpy', - version=__version__, + version=version, author='S. Kirklin', author_email='scott.kirklin@gmail.com', license='LICENSE.txt',