modules: add support for append_flags/remove_flags (#36402)

Adapt tcl and lmod modulefile templates to generate append-path or
remove-path commands in modulefile when respectively append_flags or
remove_flags commands are defined in package for run environment.

Fixes #10299.
This commit is contained in:
Xavier Delaruelle
2023-03-24 20:38:24 +01:00
committed by GitHub
parent ae504ce2fe
commit c4923fe3b3
5 changed files with 11 additions and 4 deletions

View File

@@ -144,6 +144,8 @@ def test_prepend_path_separator(self, modulefile_content, module_configuration):
assert len([x for x in content if 'append_path("SEMICOLON", "bar", ";")' in x]) == 1
assert len([x for x in content if 'prepend_path("SEMICOLON", "bar", ";")' in x]) == 1
assert len([x for x in content if 'remove_path("SEMICOLON", "bar", ";")' in x]) == 1
assert len([x for x in content if 'append_path("SPACE", "qux", " ")' in x]) == 1
assert len([x for x in content if 'remove_path("SPACE", "qux", " ")' in x]) == 1
@pytest.mark.parametrize("config_name", ["exclude", "blacklist"])
def test_exclude(self, modulefile_content, module_configuration, config_name):

View File

@@ -120,6 +120,8 @@ def test_prepend_path_separator(self, modulefile_content, module_configuration):
assert len([x for x in content if 'append-path --delim ";" SEMICOLON "bar"' in x]) == 1
assert len([x for x in content if 'prepend-path --delim ";" SEMICOLON "bar"' in x]) == 1
assert len([x for x in content if 'remove-path --delim ";" SEMICOLON "bar"' in x]) == 1
assert len([x for x in content if 'append-path --delim " " SPACE "qux"' in x]) == 1
assert len([x for x in content if 'remove-path --delim " " SPACE "qux"' in x]) == 1
@pytest.mark.parametrize("config_name", ["exclude", "blacklist"])
def test_exclude(self, modulefile_content, module_configuration, config_name):