Skip to content

Commit

Permalink
hound fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Soenen committed Jun 17, 2022
1 parent 0066a71 commit 9df685d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions easybuild/tools/module_naming_scheme/generation_mns.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

GMNS_ENV = "GENERATION_MODULE_NAMING_SCHEME_LOOKUP_TABLE"


class GenerationModuleNamingScheme(ModuleNamingScheme):
"""Class implementing the generational module naming scheme."""

Expand Down Expand Up @@ -71,14 +72,14 @@ def __init__(self):
print_result=False)
self.generations = [x.split('-')[1].split('.')[0] for x in foss_filenames]

# get_toolchain_hierarchy() depends on ActiveMNS(), which can't point to
# get_toolchain_hierarchy() depends on ActiveMNS(), which can't point to
# GenerationModuleNamingScheme to prevent circular reference errors. For that purpose, the MNS
# that ActiveMNS() points to is tweaked while get_toolchain_hierarchy() is used.
ConfigurationVariables()._FrozenDict__dict['module_naming_scheme'] = 'EasyBuildMNS'

# map generations on toolchains
for generation in self.generations:
for tc in get_toolchain_hierarchy({'name':'foss', 'version':generation}):
for tc in get_toolchain_hierarchy({'name': 'foss', 'version': generation}):
self.lookup_table[(tc['name'], tc['version'])] = generation
# include (foss, <generation>) as a toolchain aswell
self.lookup_table[('foss', generation)] = generation
Expand Down
2 changes: 1 addition & 1 deletion test/framework/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ def test_ec(ecfile, short_modname, mod_subdir, modpath_exts, user_modpath_exts,
# test error for examples without toolchain-generation mapping in lookup table. EasyConfig() calls
# det_module_subdir() of the generationModuleNamingScheme object for the toolchain (binutils)
with self.assertRaises(EasyBuildError) as cm:
ec = EasyConfig(glob.glob(os.path.join(ecs_dir, '*', '*', 'hwloc-1.6.2-GCC-4.9.3-2.26.eb'))[0])
EasyConfig(glob.glob(os.path.join(ecs_dir, '*', '*', 'hwloc-1.6.2-GCC-4.9.3-2.26.eb'))[0])

msg = "Couldn't map software version (binutils, 2.26) to a generation. Provide a customtoolchain " \
"mapping through GENERATION_MODULE_NAMING_SCHEME_LOOKUP_TABLE"
Expand Down

0 comments on commit 9df685d

Please sign in to comment.