diff --git a/setup.py b/setup.py index 9dd2c3f..11ec636 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,12 @@ from io import open import os from setuptools import setup, find_packages -import shared.utils + +def get_version(prefix): + import re + with open(os.path.join(prefix, '__init__.py')) as fd: + metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fd.read())) + return metadata['version'] def read(filename): @@ -15,7 +20,7 @@ def read(filename): setup( name='django-shared-utils', - version=shared.utils.__version__, + version=get_version('shared/utils'), description=' Mix of Python and Django utility functions, classed etc.', long_description=read('README.md'), author='Erik Stein', diff --git a/shared/utils/__init__.py b/shared/utils/__init__.py index 5b46ba4..3db79a6 100644 --- a/shared/utils/__init__.py +++ b/shared/utils/__init__.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals # Erik Stein , 2007-2016 -VERSION = (0, 2, 1) -__version__ = '.'.join(map(str, VERSION)) +__version__ = '0.2.1' +VERSION = tuple(int(d) for d in __version__.split('.')) try: