Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion easybuild/easyblocks/s/scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ def __init__(self, *args, **kwargs):
super(EB_scipy, self).__init__(*args, **kwargs)

self.testinstall = True
self.testcmd = "cd .. && %(python)s -c 'import numpy; import scipy; scipy.test(verbose=2)'"
if LooseVersion(self.version) >= LooseVersion('1.0'):
# SciPy 1.0+ returns a True on success. Hence invert to get a failure value
test_code = 'sys.exit(not scipy.test(verbose=2))'
else:
# Return value is a TextTestResult. Check the errors member for any error
test_code = 'sys.exit(len(scipy.test(verbose=2).errors) > 0)'
# Prepend imports
test_code = "import sys; import scipy; " + test_code
# LDFLAGS should not be set when testing numpy/scipy, because it overwrites whatever numpy/scipy sets
# see http://projects.scipy.org/numpy/ticket/182
self.testcmd = "unset LDFLAGS && cd .. && %%(python)s -c '%s'" % test_code

def configure_step(self):
"""Custom configure step for scipy: set extra installation options when needed."""
Expand Down