Skip to content

Commit dcbd5c9

Browse files
authored
Merge pull request #4678 from Flamefire/dry-run-multi-deps
fix dry-run output when using `multi_deps`
2 parents a0f8b99 + 56da654 commit dcbd5c9

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

easybuild/framework/easyblock.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,21 +3072,24 @@ def post_install_step(self):
30723072
# create *relative* 'lib' symlink to 'lib64';
30733073
symlink('lib64', lib_dir, use_abspath_source=False)
30743074

3075+
def _dispatch_sanity_check_step(self, *args, **kwargs):
3076+
"""Decide whether to run the dry-run or the real version of the sanity-check step"""
3077+
if self.dry_run:
3078+
self._sanity_check_step_dry_run(*args, **kwargs)
3079+
else:
3080+
self._sanity_check_step(*args, **kwargs)
3081+
30753082
def sanity_check_step(self, *args, **kwargs):
30763083
"""
30773084
Do a sanity check on the installation
30783085
- if *any* of the files/subdirectories in the installation directory listed
30793086
in sanity_check_paths are non-existent (or empty), the sanity check fails
30803087
"""
3081-
if self.dry_run:
3082-
self._sanity_check_step_dry_run(*args, **kwargs)
3083-
30843088
# handling of extensions that were installed for multiple dependency versions is done in ExtensionEasyBlock
3085-
elif self.cfg['multi_deps'] and not self.is_extension:
3089+
if self.cfg['multi_deps'] and not self.is_extension:
30863090
self._sanity_check_step_multi_deps(*args, **kwargs)
3087-
30883091
else:
3089-
self._sanity_check_step(*args, **kwargs)
3092+
self._dispatch_sanity_check_step(*args, **kwargs)
30903093

30913094
def _sanity_check_step_multi_deps(self, *args, **kwargs):
30923095
"""Perform sanity check for installations that iterate over a list a versions for particular dependencies."""
@@ -3118,7 +3121,7 @@ def _sanity_check_step_multi_deps(self, *args, **kwargs):
31183121
self.log.info(info_msg)
31193122

31203123
kwargs['extra_modules'] = extra_modules
3121-
self._sanity_check_step(*args, **kwargs)
3124+
self._dispatch_sanity_check_step(*args, **kwargs)
31223125

31233126
# restore list of lists of build dependencies & stop iterating again
31243127
self.cfg['builddependencies'] = builddeps
@@ -3379,14 +3382,13 @@ def _sanity_check_step_common(self, custom_paths, custom_commands):
33793382
# if enhance_sanity_check is enabled *and* sanity_check_paths are specified in the easyconfig,
33803383
# those paths are used to enhance the paths provided by the easyblock
33813384
if enhance_sanity_check and ec_paths:
3382-
for key in ec_paths:
3383-
val = ec_paths[key]
3385+
for key, val in ec_paths.items():
33843386
if isinstance(val, list):
33853387
paths[key] = paths.get(key, []) + val
33863388
else:
3387-
error_pattern = "Incorrect value type in sanity_check_paths, should be a list: "
3388-
error_pattern += "%s (type: %s)" % (val, type(val))
3389-
raise EasyBuildError(error_pattern)
3389+
error_msg = "Incorrect value type in sanity_check_paths, should be a list: "
3390+
error_msg += "%s (type: %s)" % (val, type(val))
3391+
raise EasyBuildError(error_msg)
33903392
self.log.info("Enhanced sanity check paths after taking into account easyconfig file: %s", paths)
33913393

33923394
sorted_keys = sorted(paths.keys())

easybuild/tools/include.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,8 @@ def include_easyblocks(tmpdir, paths):
198198

199199
# hard inject location to included (generic) easyblocks into Python search path
200200
# only prepending to sys.path is not enough due to 'pkgutil.extend_path' in easybuild/easyblocks/__init__.py
201-
new_path = os.path.join(easyblocks_path, 'easybuild', 'easyblocks')
202-
easybuild.easyblocks.__path__.insert(0, new_path)
203-
new_path = os.path.join(new_path, 'generic')
204-
easybuild.easyblocks.generic.__path__.insert(0, new_path)
201+
easybuild.easyblocks.__path__.insert(0, easyblocks_dir)
202+
easybuild.easyblocks.generic.__path__.insert(0, os.path.join(easyblocks_dir, 'generic'))
205203

206204
# sanity check: verify that included easyblocks can be imported (from expected location)
207205
for subdir, ebs in [('', included_ebs), ('generic', included_generic_ebs)]:

0 commit comments

Comments
 (0)