Skip to content

Commit

Permalink
don't load fake module to run 'pip check', just check it is loaded, s…
Browse files Browse the repository at this point in the history
…ince module is already loaded at start of PythonPackage.sanity_check_step
  • Loading branch information
boegel committed Nov 24, 2022
1 parent b7f8ccf commit 57288b6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,14 @@ def sanity_check_step(self, *args, **kwargs):

if not self.is_extension:
# for stand-alone Python package installations (not part of a bundle of extensions),
# we need to load the fake module file, otherwise the Python package being installed
# is not "in view", and we will overlook missing dependencies...
fake_mod_data = self.load_fake_module(purge=True)
# the (fake or real) module file must be loaded at this point,
# otherwise the Python package being installed is not "in view",
# and we will overlook missing dependencies...
loaded_modules = [x['mod_name'] for x in self.modules_tool.list()]
if self.short_mod_name not in loaded_modules:
self.log.debug("Currently loaded modules: %s", loaded_modules)
raise EasyBuildError("%s module is not loaded, this should never happen...",
self.short_mod_name)

pip_check_errors = []

Expand Down Expand Up @@ -908,9 +913,6 @@ def sanity_check_step(self, *args, **kwargs):
) % (faulty_version, '\n'.join(faulty_pkg_names))
pip_check_errors.append(msg)

if not self.is_extension:
self.clean_up_fake_module(fake_mod_data)

if pip_check_errors:
raise EasyBuildError('\n'.join(pip_check_errors))
else:
Expand Down

0 comments on commit 57288b6

Please sign in to comment.