11import os
22import sys
33import subprocess
4- import shutil
54
65"""
76Using this test file.
@@ -64,6 +63,7 @@ def print_progress_header(text):
6463PYTHON_EXE = os .path .abspath (ENV_NAME + "/bin/python" )
6564CYTHON_DIR = os .path .abspath (os .path .join (SRC_DIR , "cython-0.22" ))
6665NUMPY_DIR = os .path .abspath (os .path .join (SRC_DIR , "numpy" ))
66+ SCIPY_DIR = os .path .abspath (os .path .join (SRC_DIR , "scipy" ))
6767
6868print_progress_header ("Setting up Cython..." )
6969if not os .path .exists (CYTHON_DIR ):
@@ -77,7 +77,6 @@ def print_progress_header(text):
7777 subprocess .check_call (["patch" , "-p1" , "--input=" + PATCH_FILE ], cwd = CYTHON_DIR )
7878 print ">>> Applied Cython patch"
7979
80-
8180 try :
8281 subprocess .check_call ([PYTHON_EXE , "setup.py" , "install" ], cwd = CYTHON_DIR )
8382 subprocess .check_call ([PYTHON_EXE , "-c" , "import Cython" ], cwd = CYTHON_DIR )
@@ -86,6 +85,10 @@ def print_progress_header(text):
8685else :
8786 print ">>> Cython already installed."
8887
88+ env = os .environ
89+ CYTHON_BIN_DIR = os .path .abspath (os .path .join (ENV_NAME + "/bin" ))
90+ env ["PATH" ] = CYTHON_BIN_DIR + ":" + env ["PATH" ]
91+
8992print_progress_header ("Cloning up NumPy..." )
9093if not os .path .exists (NUMPY_DIR ):
9194 url = "https://github.com/numpy/numpy"
@@ -94,10 +97,6 @@ def print_progress_header(text):
9497 print ">>> NumPy already installed."
9598
9699try :
97- env = os .environ
98- CYTHON_BIN_DIR = os .path .abspath (os .path .join (ENV_NAME + "/bin" ))
99- env ["PATH" ] = CYTHON_BIN_DIR + ":" + env ["PATH" ]
100-
101100 print_progress_header ("Setting up NumPy..." )
102101 subprocess .check_call ([PYTHON_EXE , "setup.py" , "build" ], cwd = NUMPY_DIR , env = env )
103102
@@ -109,6 +108,25 @@ def print_progress_header(text):
109108
110109 raise
111110
111+ print_progress_header ("Cloning up SciPy..." )
112+ if not os .path .exists (SCIPY_DIR ):
113+ url = "https://github.com/scipy/scipy"
114+ # subprocess.check_call(["git", "clone", "--depth", "1", "--branch", "v0.17.1", url], cwd=SRC_DIR)
115+ else :
116+ print ">>> SciPy already installed."
117+
118+ try :
119+ print_progress_header ("Setting up SciPy..." )
120+ # subprocess.check_call([PYTHON_EXE, "setup.py", "build"], cwd=SCIPY_DIR, env=env)
121+
122+ print_progress_header ("Installing SciPy..." )
123+ # subprocess.check_call([PYTHON_EXE, "setup.py", "install"], cwd=SCIPY_DIR, env=env)
124+ except :
125+ subprocess .check_call (["rm" , "-rf" , SCIPY_DIR + "/build" ])
126+ subprocess .check_call (["rm" , "-rf" , SCIPY_DIR + "/dist" ])
127+
128+ raise
129+
112130# From Wikipedia
113131script = """
114132import numpy as np
0 commit comments