Skip to content

Commit

Permalink
load module early during PythonPackage's sanity check step via sanity…
Browse files Browse the repository at this point in the history
…_check_load_module (fixes #2745)
  • Loading branch information
boegel committed Nov 16, 2022
1 parent 4f9c56b commit b7f8ccf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,14 @@ def sanity_check_step(self, *args, **kwargs):

success, fail_msg = True, ''

# load module early ourselves rather than letting parent sanity_check_step method do so,
# since custom actions taken below require that environment is set up properly already
# (especially when using --sanity-check-only)
if not self.sanity_check_module_loaded:
extension = self.is_extension or kwargs.get('extension', False)
extra_modules = kwargs.get('extra_modules', None)
self.fake_mod_data = self.sanity_check_load_module(extension=extension, extra_modules=extra_modules)

# don't add user site directory to sys.path (equivalent to python -s)
# see https://www.python.org/dev/peps/pep-0370/;
# must be set here to ensure that it is defined when running sanity check for extensions,
Expand Down

0 comments on commit b7f8ccf

Please sign in to comment.