Skip to content

Commit 4592785

Browse files
committed
Merge branch 'graingert-patch-2'
2 parents 0900c55 + 2253d39 commit 4592785

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

setup.py

+19-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from distutils.command.build_py import build_py as _build_py
1111
from setuptools.command.sdist import sdist as _sdist
12+
import pkg_resources
13+
import logging
1214
import os
1315
import sys
1416
from os import path
@@ -68,8 +70,23 @@ def _stamp_version(filename):
6870
print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr)
6971

7072
install_requires = ['gitdb >= 0.6.4']
71-
if sys.version_info[:2] < (2, 7):
72-
install_requires.append('ordereddict')
73+
extras_require = {
74+
':python_version == "2.6"': ['ordereddict'],
75+
}
76+
77+
try:
78+
if 'bdist_wheel' not in sys.argv:
79+
for key, value in extras_require.items():
80+
if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]):
81+
install_requires.extend(value)
82+
except Exception:
83+
logging.getLogger(__name__).exception(
84+
'Something went wrong calculating platform specific dependencies, so '
85+
"you're getting them all!"
86+
)
87+
for key, value in extras_require.items():
88+
if key.startswith(':'):
89+
install_requires.extend(value)
7390
# end
7491

7592
setup(

0 commit comments

Comments
 (0)