Skip to content

Commit f890709

Browse files
authored
Merge pull request #346 from carsonyl/patch-1
Convert extras_require conditional deps to PEP 508 form.
2 parents 1562bc7 + d0ae5fa commit f890709

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

setup.py

+8-26
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env python
22

33
import sys
4-
import logging
54

65
from setuptools import setup, find_packages
76
from setuptools.command.test import test as TestCommand
8-
import pkg_resources
97

108
long_description = open('README.rst', 'r').read()
119

@@ -24,29 +22,14 @@ def run_tests(self):
2422
sys.exit(errno)
2523

2624

27-
install_requires = ['PyYAML', 'wrapt', 'six>=1.5']
28-
29-
30-
extras_require = {
31-
':python_version in "2.7"': ['contextlib2', 'mock'],
32-
':python_version in "3.4, 3.5, 3.6"': ['yarl'],
33-
}
34-
35-
36-
try:
37-
if 'bdist_wheel' not in sys.argv:
38-
for key, value in extras_require.items():
39-
if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
40-
install_requires.extend(value)
41-
except Exception:
42-
logging.getLogger(__name__).exception(
43-
'Something went wrong calculating platform specific dependencies, so '
44-
"you're getting them all!"
45-
)
46-
for key, value in extras_require.items():
47-
if key.startswith(':'):
48-
install_requires.extend(value)
49-
25+
install_requires = [
26+
'PyYAML',
27+
'wrapt',
28+
'six>=1.5',
29+
'contextlib2; python_version=="2.7"',
30+
'mock; python_version=="2.7"',
31+
'yarl; python_version>="3.4"',
32+
]
5033

5134
excluded_packages = ["tests*"]
5235
if sys.version_info[0] == 2:
@@ -66,7 +49,6 @@ def run_tests(self):
6649
packages=find_packages(exclude=excluded_packages),
6750
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
6851
install_requires=install_requires,
69-
extras_require=extras_require,
7052
license='MIT',
7153
tests_require=['pytest', 'mock', 'pytest-httpbin'],
7254
classifiers=[

0 commit comments

Comments
 (0)