@@ -24,6 +24,7 @@ def print_progress_header(text):
24
24
PYTHON_EXE = os .path .abspath (ENV_NAME + "/bin/python" )
25
25
CYTHON_DIR = os .path .abspath (os .path .join (SRC_DIR , "cython" ))
26
26
NUMPY_DIR = os .path .abspath (os .path .join (SRC_DIR , "numpy" ))
27
+ SCIPY_DIR = os .path .abspath (os .path .join (SRC_DIR , "scipy" ))
27
28
28
29
print_progress_header ("Setting up Cython..." )
29
30
if not os .path .exists (CYTHON_DIR ):
@@ -52,11 +53,12 @@ def print_progress_header(text):
52
53
else :
53
54
print ">>> NumPy already installed."
54
55
55
- try :
56
- env = os .environ
57
- CYTHON_BIN_DIR = os . path . abspath ( os . path . join ( ENV_NAME + "/bin" ))
58
- env ["PATH" ] = CYTHON_BIN_DIR + ":" + env ["PATH" ]
56
+ env = os . environ
57
+ CYTHON_BIN_DIR = os .path . abspath ( os . path . join ( ENV_NAME + "/bin" ))
58
+ env [ 'NPY_NUM_BUILD_JOBS' ] = '8'
59
+ env ["PATH" ] = CYTHON_BIN_DIR + ":" + env ["PATH" ]
59
60
61
+ try :
60
62
# Should be able to do this:
61
63
# subprocess.check_call([os.path.join(SRC_DIR, "bin/pip"), "install", NUMPY_DIR])
62
64
# but they end up naming f2py "f2py_release"/"f2py_dbg"
@@ -73,8 +75,32 @@ def print_progress_header(text):
73
75
74
76
raise
75
77
76
- test_helper .run_test (['sh' , '-c' , '. %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py' % (ENV_DIR , ENV_DIR )],
77
- ENV_NAME , [dict (ran = 6139 , failures = 1 )])
78
+ # test_helper.run_test(['sh', '-c', '. %s/bin/activate && python %s/numpy/tools/test-installed-numpy.py' % (ENV_DIR, ENV_DIR)],
79
+ # ENV_NAME, [dict(ran=6139, failures=1)])
80
+
81
+ if not os .path .exists (SCIPY_DIR ):
82
+ print_progress_header ("Cloning up SciPy..." )
83
+ url = "https://github.com/scipy/scipy"
84
+ subprocess .check_call (["git" , "clone" , "--depth" , "1" , "--branch" , "v0.17.1" , url ], cwd = SRC_DIR )
85
+ else :
86
+ print ">>> SciPy already installed."
87
+
88
+ try :
89
+ print_progress_header ("Setting up SciPy..." )
90
+ subprocess .check_call ([PYTHON_EXE , "setup.py" , "build" ], cwd = SCIPY_DIR , env = env )
91
+
92
+ print_progress_header ("Installing SciPy..." )
93
+ subprocess .check_call ([PYTHON_EXE , "setup.py" , "install" ], cwd = SCIPY_DIR , env = env )
94
+ except :
95
+ subprocess .check_call (["rm" , "-rf" , SCIPY_DIR + "/build" ])
96
+ subprocess .check_call (["rm" , "-rf" , SCIPY_DIR + "/dist" ])
97
+ raise
98
+
99
+ scip_test = "import scipy; scipy.test(verbose=2)"
100
+
101
+ print_progress_header ("Running SciPy test suite..." )
102
+ expected = [{'ran' : 20391 }]
103
+ test_helper .run_test ([PYTHON_EXE , "-c" , scip_test ], cwd = CYTHON_DIR , expected = expected )
78
104
79
105
print
80
106
print "PASSED"
0 commit comments