From 472b186eb3032137d117789a5f52ff1dba1cd04d Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Wed, 20 Feb 2013 22:50:12 +0100 Subject: [PATCH] setup.py: do not import the module to read the __version__ --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 054073b..70693e8 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,12 @@ from __future__ import with_statement from setuptools import setup -from flake8 import __version__ + +def get_version(fname='flake8/__init__.py'): + with open(fname) as f: + for line in f: + if line.startswith('__version__'): + return eval(line.split('=')[-1]) def get_long_description(): @@ -16,7 +21,7 @@ def get_long_description(): setup( name="flake8", license="MIT", - version=__version__, + version=get_version(), description="the modular source code checker: pep8, pyflakes and co", long_description=get_long_description(), author="Tarek Ziade",