diff --git a/setup.py b/setup.py index dfacc5e..be21344 100755 --- a/setup.py +++ b/setup.py @@ -2,8 +2,26 @@ import os from setuptools import setup, find_packages + +import re +here = os.path.dirname(os.path.abspath(__file__)) +version_re = re.compile( + r'__version__ = (\(.*?\))') +fp = open(os.path.join(here, 'coffin', '__init__.py')) +version = None +for line in fp: + match = version_re.search(line) + if match: + version = eval(match.group(1)) + break +else: + raise Exception("Cannot find version in __init__.py") +fp.close() + + + setup(name='Coffin', - version=".".join(map(str, __import__("coffin").__version__)), + version=".".join(map(str, version)), description='Jinja2 adapter for Django', author='Christopher D. Leary', author_email='cdleary@gmail.com',