Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions easybuild/framework/easyconfig/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
:author: Ward Poelmans (Ghent University)
"""
import copy
import fnmatch
import glob
import os
import re
Expand Down Expand Up @@ -360,6 +361,10 @@ def det_easyconfig_paths(orig_paths):
# if no easyconfigs are specified, use all the ones touched in the PR
ec_files = [path for path in pr_files if path.endswith('.eb')]

filter_ecs = build_option('filter_ecs')
if filter_ecs:
ec_files = [ec for ec in ec_files
if not any(fnmatch.fnmatch(ec, filter_spec) for filter_spec in filter_ecs)]
if ec_files and robot_path:
ignore_subdirs = build_option('ignore_dirs')
if not build_option('consider_archived_easyconfigs'):
Expand Down
1 change: 1 addition & 0 deletions easybuild/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
'envvars_user_modules',
'extra_modules',
'filter_deps',
'filter_ecs',
'filter_env_vars',
'hide_deps',
'hide_toolchains',
Expand Down
3 changes: 3 additions & 0 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ def override_options(self):
'filter-deps': ("List of dependencies that you do *not* want to install with EasyBuild, "
"because equivalent OS packages are installed. (e.g. --filter-deps=zlib,ncurses)",
'strlist', 'extend', None),
'filter-ecs': ("List of easyconfigs (given as glob patterns) to *ignore* when given on command line "
"or auto-selected when building with --from-pr. (e.g. --filter-ecs=*intel*)",
'strlist', 'extend', None),
'filter-env-vars': ("List of names of environment variables that should *not* be defined/updated by "
"module files generated by EasyBuild", 'strlist', 'extend', None),
'fixed-installdir-naming-scheme': ("Use fixed naming scheme for installation directories", None,
Expand Down
17 changes: 17 additions & 0 deletions test/framework/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,23 @@ def test_det_easyconfig_paths(self):
regex = re.compile(r"^ \* \[.\] .*/__archive__/.*/intel-2012a.eb \(module: intel/2012a\)", re.M)
self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt))

args = [
os.path.join(test_ecs_path, 't', 'toy', 'toy-0.0.eb'),
os.path.join(test_ecs_path, 't', 'toy', 'toy-0.0-gompi-2018a-test.eb'),
os.path.join(test_ecs_path, 't', 'toy', 'toy-0.0-gompi-2018a.eb'),
'--dry-run',
'--robot',
'--tmpdir=%s' % self.test_prefix,
'--filter-ecs=*oy-0.0.eb,*-test.eb',
]
outtxt = self.eb_main(args, raise_error=True)

regex = re.compile(r"^ \* \[.\] .*/toy-0.0-gompi-2018a.eb \(module: toy/0.0-gompi-2018a\)", re.M)
self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt))
for ec in ('toy-0.0.eb', 'toy-0.0-gompi-2018a-test.eb'):
regex = re.compile(r"^ \* \[.\] .*/%s \(module:" % ec, re.M)
self.assertFalse(regex.search(outtxt), "%s should be fitered in %s" % (ec, outtxt))

def test_search_paths(self):
"""Test search_paths command line argument."""
fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log')
Expand Down