diff --git a/sanic/__init__.py b/sanic/__init__.py index b7be9aaf..618368d4 100644 --- a/sanic/__init__.py +++ b/sanic/__init__.py @@ -1,4 +1,6 @@ from .sanic import Sanic from .blueprints import Blueprint +__version__ = '0.1.6' + __all__ = ['Sanic', 'Blueprint'] diff --git a/setup.py b/setup.py index 2e4e67e7..60606ad4 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,23 @@ """ Sanic """ +import codecs +import os +import re from setuptools import setup + +with codecs.open(os.path.join(os.path.abspath(os.path.dirname( + __file__)), 'sanic', '__init__.py'), 'r', 'latin1') as fp: + try: + version = re.findall(r"^__version__ = '([^']+)'\r?$", + fp.read(), re.M)[0] + except IndexError: + raise RuntimeError('Unable to determine version.') + setup( name='Sanic', - version="0.1.5", + version=version, url='http://github.com/channelcat/sanic/', license='MIT', author='Channel Cat',