mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
setup.py: do not import the module to read the __version__
This commit is contained in:
parent
9a8d85d22f
commit
472b186eb3
1 changed files with 7 additions and 2 deletions
9
setup.py
9
setup.py
|
|
@ -2,7 +2,12 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
from setuptools import setup
|
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():
|
def get_long_description():
|
||||||
|
|
@ -16,7 +21,7 @@ def get_long_description():
|
||||||
setup(
|
setup(
|
||||||
name="flake8",
|
name="flake8",
|
||||||
license="MIT",
|
license="MIT",
|
||||||
version=__version__,
|
version=get_version(),
|
||||||
description="the modular source code checker: pep8, pyflakes and co",
|
description="the modular source code checker: pep8, pyflakes and co",
|
||||||
long_description=get_long_description(),
|
long_description=get_long_description(),
|
||||||
author="Tarek Ziade",
|
author="Tarek Ziade",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue