Skip to content

Commit 94530a6

Browse files
author
Boxiang Sun
committed
test
1 parent 81c744b commit 94530a6

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

from_cpython/Include/descrobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ typedef struct {
107107
PyAPI_DATA(PyTypeObject) wrappertype;
108108
PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
109109
PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
110+
#define PyMethodDescr_Check(op) (Py_TYPE(op) == &PyMethodDescr_Type)
110111

111112
#ifdef __cplusplus
112113
}

from_cpython/Lib/distutils/ccompiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ def _get_cc_args(self, pp_opts, debug, before):
372372
if before:
373373
cc_args[:0] = before
374374

375-
if not any ('scipy' in s for s in pp_opts):
376-
cc_args = cc_args + ["-Werror=implicit-function-declaration"]
375+
#if not any ('scipy' in s for s in pp_opts):
376+
# cc_args = cc_args + ["-Werror=implicit-function-declaration"]
377377
return cc_args
378378

379379
def _fix_compile_args(self, output_dir, macros, include_dirs):

test/extra/numpy_fulltest.py

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def print_progress_header(text):
2424
PYTHON_EXE = os.path.abspath(ENV_NAME + "/bin/python")
2525
CYTHON_DIR = os.path.abspath(os.path.join(SRC_DIR, "cython"))
2626
NUMPY_DIR = os.path.abspath(os.path.join(SRC_DIR, "numpy"))
27+
SCIPY_DIR = os.path.abspath(os.path.join(SRC_DIR, "scipy"))
2728

2829
print_progress_header("Setting up Cython...")
2930
if not os.path.exists(CYTHON_DIR):
@@ -52,11 +53,12 @@ def print_progress_header(text):
5253
else:
5354
print ">>> NumPy already installed."
5455

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"]
5960

61+
try:
6062
# Should be able to do this:
6163
# subprocess.check_call([os.path.join(SRC_DIR, "bin/pip"), "install", NUMPY_DIR])
6264
# but they end up naming f2py "f2py_release"/"f2py_dbg"
@@ -73,8 +75,32 @@ def print_progress_header(text):
7375

7476
raise
7577

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)
78104

79105
print
80106
print "PASSED"

test/integration/scipy_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def print_progress_header(text):
8181

8282
env = os.environ
8383
CYTHON_BIN_DIR = os.path.abspath(os.path.join(ENV_NAME + "/bin"))
84+
env['NPY_NUM_BUILD_JOBS'] = '8'
8485
env["PATH"] = CYTHON_BIN_DIR + ":" + env["PATH"]
8586

8687
print_progress_header("Cloning up NumPy...")

0 commit comments

Comments
 (0)