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):
...
@@ -38,6 +38,9 @@ def print_progress_header(text):
ENV_NAME
=
"numpy_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
)
ENV_NAME
=
"numpy_test_env_"
+
os
.
path
.
basename
(
sys
.
executable
)
DEPENDENCIES
=
[
"nose==1.3.7"
]
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
:
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..."
print
"Creating virtualenv to install testing dependencies..."
VIRTUALENV_SCRIPT
=
os
.
path
.
dirname
(
__file__
)
+
"/../lib/virtualenv/virtualenv.py"
VIRTUALENV_SCRIPT
=
os
.
path
.
dirname
(
__file__
)
+
"/../lib/virtualenv/virtualenv.py"
...
@@ -69,9 +72,10 @@ if not os.path.exists(CYTHON_DIR):
...
@@ -69,9 +72,10 @@ if not os.path.exists(CYTHON_DIR):
subprocess
.
check_call
([
"wget"
,
url
],
cwd
=
SRC_DIR
)
subprocess
.
check_call
([
"wget"
,
url
],
cwd
=
SRC_DIR
)
subprocess
.
check_call
([
"tar"
,
"-zxf"
,
"Cython-0.22.tar.gz"
],
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"
))
if
USE_CUSTOM_PATCHES
:
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
CYTHON_DIR
)
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Cython-0.22.patch"
))
print
">>> Applied Cython patch"
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
CYTHON_DIR
)
print
">>> Applied Cython patch"
try
:
try
:
...
@@ -93,8 +97,9 @@ else:
...
@@ -93,8 +97,9 @@ else:
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"numpy_patch.patch"
))
PATCH_FILE
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"numpy_patch.patch"
))
print_progress_header
(
"Patching NumPy..."
)
if
USE_CUSTOM_PATCHES
:
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
NUMPY_DIR
)
print_progress_header
(
"Patching NumPy..."
)
subprocess
.
check_call
([
"patch"
,
"-p1"
,
"--input="
+
PATCH_FILE
],
cwd
=
NUMPY_DIR
)
try
:
try
:
env
=
os
.
environ
env
=
os
.
environ
...
@@ -107,7 +112,16 @@ try:
...
@@ -107,7 +112,16 @@ try:
print_progress_header
(
"Installing NumPy..."
)
print_progress_header
(
"Installing NumPy..."
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
NUMPY_DIR
,
env
=
env
)
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"install"
],
cwd
=
NUMPY_DIR
,
env
=
env
)
except
:
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
# From Wikipedia
script
=
"""
script
=
"""
...
@@ -176,9 +190,10 @@ print_progress_header("Running NumPy test suite...")
...
@@ -176,9 +190,10 @@ print_progress_header("Running NumPy test suite...")
# when all the crashes are fixed.
# when all the crashes are fixed.
# subprocess.check_call([PYTHON_EXE, "-c", numpy_test], cwd=CYTHON_DIR)
# subprocess.check_call([PYTHON_EXE, "-c", numpy_test], cwd=CYTHON_DIR)
print_progress_header
(
"Unpatching NumPy..."
)
if
USE_CUSTOM_PATCHES
:
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-R"
,
"-d"
,
NUMPY_DIR
]
print_progress_header
(
"Unpatching NumPy..."
)
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
cmd
=
[
"patch"
,
"-p1"
,
"--forward"
,
"-i"
,
NUMPY_PATCH_FILE
,
"-R"
,
"-d"
,
NUMPY_DIR
]
subprocess
.
check_output
(
cmd
,
stderr
=
subprocess
.
STDOUT
)
print
print
print
"PASSED"
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