mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 08:24:46 +00:00
Use extras_require instead of conditional code.
Use of extras_require produces correct package metadata for flake8 regardless of the version of Python the package is built with. The conditional code produces different metadata for Python 3 and 2. The latest versions of flake8 were released with Python 3 and metadata did not contain two dependencies necessary for use with Python 2.7. See https://gitlab.com/pycqa/flake8/issues/341 for details. Account for users of setuptools<18 that still need the conditional code.
This commit is contained in:
parent
01f8824490
commit
a7068ad374
1 changed files with 11 additions and 4 deletions
15
setup.py
15
setup.py
|
|
@ -23,11 +23,17 @@ requires = [
|
||||||
"setuptools >= 30",
|
"setuptools >= 30",
|
||||||
]
|
]
|
||||||
|
|
||||||
if sys.version_info < (3, 4):
|
extras_require = {
|
||||||
requires.append("enum34")
|
":python_version<'3.4'": ['enum34'],
|
||||||
|
":python_version<'3.2'": ['configparser'],
|
||||||
|
}
|
||||||
|
|
||||||
if sys.version_info < (3, 2):
|
if int(setuptools.__version__.split('.')[0]) < 18:
|
||||||
requires.append("configparser")
|
extras_require = {}
|
||||||
|
if sys.version_info < (3, 4):
|
||||||
|
requires.append('enum34')
|
||||||
|
if sys.version_info < (3, 2):
|
||||||
|
requires.append('configparser')
|
||||||
|
|
||||||
|
|
||||||
def get_long_description():
|
def get_long_description():
|
||||||
|
|
@ -65,6 +71,7 @@ setuptools.setup(
|
||||||
"flake8.plugins",
|
"flake8.plugins",
|
||||||
],
|
],
|
||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
|
extras_require=extras_require,
|
||||||
entry_points={
|
entry_points={
|
||||||
'distutils.commands': [
|
'distutils.commands': [
|
||||||
'flake8 = flake8.main.setuptools_command:Flake8'
|
'flake8 = flake8.main.setuptools_command:Flake8'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue