Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
413d0226
Commit
413d0226
authored
May 19, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some numpy_test.py improvements
- support CPython - don't blow away the checkout each time
parent
96bcd8cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
test/integration/numpy_test.py
test/integration/numpy_test.py
+24
-9
No files found.
test/integration/numpy_test.py
View file @
413d0226
...
...
@@ -38,6 +38,9 @@ def print_progress_header(text):
ENV_NAME
=
"numpy_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
)
DEPENDENCIES
=
[
"nose==1.3.7"
]
import
platform
USE_CUSTOM_PATCHES
=
(
platform
.
python_implementation
()
==
"Pyston"
)
if
not
os
.
path
.
exists
(
ENV_NAME
)
or
os
.
stat
(
sys
.
executable
).
st_mtime
>
os
.
stat
(
ENV_NAME
+
"/bin/python"
).
st_mtime
:
print
"Creating virtualenv to install testing dependencies..."
VIRTUALENV_SCRIPT
=
os
.
path
.
dirname
(
__file__
)
+
"/../lib/virtualenv/virtualenv.py"
...
...
@@ -69,9 +72,10 @@ if not os.path.exists(CYTHON_DIR):
subprocess
.
check_call
([
"wget"
,
url
],
cwd
=
SRC_DIR
)
subprocess
.
check_call
([
"tar"
,
"-zxf"
,
"Cython-0.22.tar.gz"
],
cwd
=
SRC_DIR
)
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Cython-0.22.patch"
))
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
CYTHON_DIR
)
print
">>> Applied Cython patch"
if
USE_CUSTOM_PATCHES
:
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Cython-0.22.patch"
))
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
CYTHON_DIR
)
print
">>> Applied Cython patch"
try
:
...
...
@@ -93,8 +97,9 @@ else:
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"numpy_patch.patch"
))
print_progress_header
(
"Patching NumPy..."
)
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
NUMPY_DIR
)
if
USE_CUSTOM_PATCHES
:
print_progress_header
(
"Patching NumPy..."
)
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
NUMPY_DIR
)
try
:
env
=
os
.
environ
...
...
@@ -107,7 +112,16 @@ try:
print_progress_header
(
"Installing NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
NUMPY_DIR
,
env
=
env
)
except
:
subprocess
.
check_call
([
"rm"
,
"-rf"
,
NUMPY_DIR
])
if
USE_CUSTOM_PATCHES
:
print_progress_header
(
"Unpatching NumPy..."
)
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-R"
,
"-d"
,
NUMPY_DIR
]
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
# TODO: I'm not sure we need to do this:
subprocess
.
check_call
([
"rm"
,
"-rf"
,
NUMPY_DIR
+
"/build"
])
subprocess
.
check_call
([
"rm"
,
"-rf"
,
NUMPY_DIR
+
"/dist"
])
raise
# From Wikipedia
script
=
"""
...
...
@@ -176,9 +190,10 @@ print_progress_header("Running NumPy test suite...")
# when all the crashes are fixed.
# subprocess.check_call([PYTHON_EXE, "-c", numpy_test], cwd=CYTHON_DIR)
print_progress_header
(
"Unpatching NumPy..."
)
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-R"
,
"-d"
,
NUMPY_DIR
]
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
if
USE_CUSTOM_PATCHES
:
print_progress_header
(
"Unpatching NumPy..."
)
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-R"
,
"-d"
,
NUMPY_DIR
]
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
print
print
"PASSED"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment