Fix setup.py, do not require Jinja/Django.

This commit is contained in:
Michael Elsdörfer 2015-04-21 15:37:18 +02:00
parent 60ccdb02c9
commit 17d619248b
1 changed files with 19 additions and 1 deletions

View File

@ -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',