summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorZvezdan Petkovic <zpetkovic@acm.org>2017-06-19 18:55:36 -0700
committerZvezdan Petkovic <zpetkovic@acm.org>2017-07-10 18:20:49 -0700
commita7068ad374b01c3a6040d3f1e3f5ae4bde494e27 (patch)
treee6d19201d78db905f5aa305c2c8a2cd6b36e4ecf /setup.py
parent01f8824490a58720045e6acbb027613db05dfc7e (diff)
downloadflake8-a7068ad374b01c3a6040d3f1e3f5ae4bde494e27.tar.gz
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.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 0bb9d2e..7606633 100644
--- a/setup.py
+++ b/setup.py
@@ -23,11 +23,17 @@ requires = [
"setuptools >= 30",
]
-if sys.version_info < (3, 4):
- requires.append("enum34")
+extras_require = {
+ ":python_version<'3.4'": ['enum34'],
+ ":python_version<'3.2'": ['configparser'],
+}
-if sys.version_info < (3, 2):
- requires.append("configparser")
+if int(setuptools.__version__.split('.')[0]) < 18:
+ extras_require = {}
+ if sys.version_info < (3, 4):
+ requires.append('enum34')
+ if sys.version_info < (3, 2):
+ requires.append('configparser')
def get_long_description():
@@ -65,6 +71,7 @@ setuptools.setup(
"flake8.plugins",
],
install_requires=requires,
+ extras_require=extras_require,
entry_points={
'distutils.commands': [
'flake8 = flake8.main.setuptools_command:Flake8'