File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,24 @@ def finalize_options(self):
92
92
exec (f .read (), ABOUT )
93
93
94
94
95
- REQUIRES = [
96
- 'numpy >=1.9.0, <2.0.0'
97
- ]
95
+ NUMPY_REQUIREMENT = ['numpy >=1.9.0, <2.0.0' ]
96
+
97
+ # Copied from scipy's installer, to solve the same issues they saw:
98
+
99
+ # Figure out whether to add ``*_requires = ['numpy']``.
100
+ # We don't want to do that unconditionally, because we risk updating
101
+ # an installed numpy which fails too often. Just if it's not installed, we
102
+ # may give it a try. See scipy gh-3379.
103
+ try :
104
+ import numpy
105
+ except ImportError : # We do not have numpy installed
106
+ REQUIRES = NUMPY_REQUIREMENT
107
+ else :
108
+ # If we're building a wheel, assume there already exist numpy wheels
109
+ # for this platform, so it is safe to add numpy to build requirements.
110
+ # See scipy gh-5184.
111
+ REQUIRES = (NUMPY_REQUIREMENT if 'bdist_wheel' in sys .argv [1 :]
112
+ else [])
98
113
99
114
setup (
100
115
name = ABOUT ['__title__' ],
You can’t perform that action at this time.
0 commit comments