8000 MAINT Use install_requires for numpy and scipy (#10402) · scikit-learn/scikit-learn@66bf809 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66bf809

Browse files
barrywhartjnothman
authored andcommitted
MAINT Use install_requires for numpy and scipy (#10402)
1 parent 74b69df commit 66bf809

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

setup.py

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def configuration(parent_package='', top_path=None):
123123
os.remove('MANIFEST')
124124

125125
from numpy.distutils.misc_util import Configuration
126+
126127
config = Configuration(None, parent_package, top_path)
127128

128129
# Avoid non-useful msg:
@@ -137,26 +138,6 @@ def configuration(parent_package='', top_path=None):
137138
return config
138139

139140

140-
def get_scipy_status():
141-
"""
142-
Returns a dictionary containing a boolean specifying whether SciPy
143-
is up-to-date, along with the version string (empty string if
144-
not installed).
145-
"""
146-
scipy_status = {}
147-
try:
148-
import scipy
149-
scipy_version = scipy.__version__
150-
scipy_status['up_to_date'] = parse_version(
151-
scipy_version) >= parse_version(SCIPY_MIN_VERSION)
152-
scipy_status['version'] = scipy_version
153-
except ImportError:
154-
traceback.print_exc()
155-
scipy_status['up_to_date'] = False
156-
scipy_status['version'] = ""
157-
return scipy_status
158-
159-
160141
def get_numpy_status():
161142
"""
162143
Returns a dictionary containing a boolean specifying whether NumPy
@@ -206,6 +187,10 @@ def setup_package():
206187
'Programming Language :: Python :: 3.6',
207188
],
208189
cmdclass=cmdclass,
190+
install_requires=[
191+
'numpy>={0}'.format(NUMPY_MIN_VERSION),
192+
'scipy>={0}'.format(SCIPY_MIN_VERSION)
193+
],
209194
**extra_setuptools_args)
210195

211196
if len(sys.argv) == 1 or (
@@ -229,9 +214,6 @@ def setup_package():
229214
numpy_status = get_numpy_status()
230215
numpy_req_str = "scikit-learn requires NumPy >= {0}.\n".format(
231216
NUMPY_MIN_VERSION)
232-
scipy_status = get_scipy_status()
233-
scipy_req_str = "scikit-learn requires SciPy >= {0}.\n".format(
234-
SCIPY_MIN_VERSION)
235217

236218
instructions = ("Installation instructions are available on the "
237219
"scikit-learn website: "
@@ -247,16 +229,6 @@ def setup_package():
247229
raise ImportError("Numerical Python (NumPy) is not "
248230
"installed.\n{0}{1}"
249231
.format(numpy_req_str, instructions))
250-
if scipy_status['up_to_date'] is False:
251-
if scipy_status['version']:
252-
raise ImportError("Your installation of Scientific Python "
253-
"(SciPy) {0} is out-of-date.\n{1}{2}"
254-
.format(scipy_status['version'],
255-
scipy_req_str, instructions))
6815
256-
else:
257-
raise ImportError("Scientific Python (SciPy) is not "
258-
"installed.\n{0}{1}"
259-
.format(scipy_req_str, instructions))
260232

261233
from numpy.distutils.core import setup
262234

0 commit comments

Comments
 (0)
0