Skip to content

Commit

Permalink
Merge pull request #2 from boegel/20230117154815_new_pr_scipy
Browse files Browse the repository at this point in the history
simplify logic to set default value for ignore_test_result in scipy easyblock
  • Loading branch information
jfgrimm authored Feb 25, 2023
2 parents 41b424c + f53a4c6 commit 15a508f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions easybuild/easyblocks/s/scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def extra_options():
"""Easyconfig parameters specific to scipy."""
extra_vars = ({
'enable_slow_tests': [False, "Run scipy test suite, including tests marked as slow", CUSTOM],
# ignore test failures by default in scipy < 1.9 to maintain behaviour in older easyconfigs
'ignore_test_result': [None, "Run scipy test suite, but ignore test failures (True/False/None). Default "
"(None) implies True for scipy < 1.9, and False for scipy >= 1.9", CUSTOM],
})
Expand Down Expand Up @@ -85,16 +84,15 @@ def __init__(self, *args, **kwargs):
self.use_meson = False

if self.cfg['ignore_test_result'] is None:
# enforce scipy test suite results if not explicitly disabled for scipy >= 1.9
if self.use_meson:
self.cfg['ignore_test_result'] = False
else:
self.cfg['ignore_test_result'] = True
# automatically ignore scipy test suite results for scipy < 1.9, as we did in older easyconfigs
self.cfg['ignore_test_result'] = LooseVersion(self.version) < '1.9'
self.log.info("ignore_test_result not specified, so automatically set to %s for scipy %s",
self.cfg['ignore_test_result'], self.version)

if self.cfg['ignore_test_result']:
# can be used to maintain compatibility with easyconfigs predating scipy 1.9. Runs tests
# (serially) in a way that exits with code 0 regardless of test results, see:
# https://github.com/easybuilders/easybuild-easyblocks/issues/2237
# used to maintain compatibility with easyconfigs predating scipy 1.9;
# runs tests (serially) in a way that exits with code 0 regardless of test results,
# see https://github.com/easybuilders/easybuild-easyblocks/issues/2237
self.testcmd = "cd .. && %(python)s -c 'import numpy; import scipy; scipy.test(verbose=2)'"
else:
self.testcmd = " && ".join([
Expand Down

0 comments on commit 15a508f

Please sign in to comment.