Skip to content

Commit 211803d

Browse files
authored
Merge pull request #4439 from branfosj/modules
deprecate support for `EnvironmentModulesC` and `EnvironmentModulesTcl` module tools
2 parents 80c9718 + cc2a478 commit 211803d

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
outputs:
1616
lmod8: Lmod-8.7.6
17-
modulesTcl: modules-tcl-1.147
18-
modules3: modules-3.2.10
1917
modules4: modules-4.1.4
2018
steps:
2119
- run: "true"
@@ -29,8 +27,6 @@ jobs:
2927
# use variables defined by 'setup' job above, see also
3028
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
3129
- ${{needs.setup.outputs.lmod8}}
32-
- ${{needs.setup.outputs.modulesTcl}}
33-
- ${{needs.setup.outputs.modules3}}
3430
- ${{needs.setup.outputs.modules4}}
3531
lc_all: [""]
3632
include:
@@ -156,11 +152,7 @@ jobs:
156152
export PYTHONPATH=$PREFIX/lib/python${{matrix.python}}/site-packages:$PYTHONPATH
157153
eb --version
158154
# tell EasyBuild which modules tool is available
159-
if [[ ${{matrix.modules_tool}} =~ ^modules-tcl- ]]; then
160-
export EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl
161-
elif [[ ${{matrix.modules_tool}} =~ ^modules-3 ]]; then
162-
export EASYBUILD_MODULES_TOOL=EnvironmentModulesC
163-
elif [[ ${{matrix.modules_tool}} =~ ^modules-4 ]]; then
155+
if [[ ${{matrix.modules_tool}} =~ ^modules-4 ]]; then
164156
export EASYBUILD_MODULES_TOOL=EnvironmentModules
165157
else
166158
export EASYBUILD_MODULES_TOOL=Lmod

easybuild/tools/modules.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,7 @@ def set_and_check_version(self):
272272
if StrictVersion(self.version) < StrictVersion(self.DEPR_VERSION):
273273
depr_msg = "Support for %s version < %s is deprecated, " % (self.NAME, self.DEPR_VERSION)
274274
depr_msg += "found version %s" % self.version
275-
276-
if self.version.startswith('6') and 'Lmod6' in build_option('silence_deprecation_warnings'):
277-
self.log.warning(depr_msg)
278-
else:
279-
self.log.deprecated(depr_msg, '5.0')
275+
self.log.deprecated(depr_msg, '6.0')
280276

281277
if self.MAX_VERSION is not None:
282278
self.log.debug("Maximum allowed %s version defined: %s", self.NAME, self.MAX_VERSION)
@@ -1185,6 +1181,7 @@ class EnvironmentModulesC(ModulesTool):
11851181
COMMAND = "modulecmd"
11861182
REQ_VERSION = '3.2.10'
11871183
MAX_VERSION = '3.99'
1184+
DEPR_VERSION = '3.999'
11881185
VERSION_REGEXP = r'^\s*(VERSION\s*=\s*)?(?P<version>\d\S*)\s*'
11891186

11901187
def run_module(self, *args, **kwargs):
@@ -1246,6 +1243,7 @@ class EnvironmentModulesTcl(EnvironmentModulesC):
12461243
COMMAND_SHELL = ['tclsh']
12471244
VERSION_OPTION = ''
12481245
REQ_VERSION = None
1246+
DEPR_VERSION = '9999.9'
12491247
VERSION_REGEXP = r'^Modules\s+Release\s+Tcl\s+(?P<version>\d\S*)\s'
12501248

12511249
def set_path_env_var(self, key, paths):
@@ -1320,6 +1318,7 @@ class EnvironmentModules(EnvironmentModulesTcl):
13201318
COMMAND = os.path.join(os.getenv('MODULESHOME', 'MODULESHOME_NOT_DEFINED'), 'libexec', 'modulecmd.tcl')
13211319
COMMAND_ENVIRONMENT = 'MODULES_CMD'
13221320
REQ_VERSION = '4.0.0'
1321+
DEPR_VERSION = '4.0.0' # needs to be set as EnvironmentModules inherits from EnvironmentModulesTcl
13231322
MAX_VERSION = None
13241323
VERSION_REGEXP = r'^Modules\s+Release\s+(?P<version>\d[^+\s]*)(\+\S*)?\s'
13251324

test/framework/modules.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,8 +1543,10 @@ def test_modulecmd_strip_source(self):
15431543

15441544
os.environ['PATH'] = '%s:%s' % (self.test_prefix, os.getenv('PATH'))
15451545

1546-
modtool = EnvironmentModulesC()
1547-
modtool.run_module('load', 'test123')
1546+
self.allow_deprecated_behaviour()
1547+
with self.mocked_stdout_stderr():
1548+
modtool = EnvironmentModulesC()
1549+
modtool.run_module('load', 'test123')
15481550
self.assertEqual(os.getenv('TEST123'), 'test123')
15491551

15501552
def test_get_setenv_value_from_modulefile(self):

0 commit comments

Comments
 (0)