From a682cb0d6312e843e733cd4155523fb75c8514ee Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 11 Oct 2024 10:38:53 +0200 Subject: [PATCH 1/2] fix `enhance_sanity_check` for `PythonPackage` When trying to add, not replace paths/commands for the sanity check of Python packages the default `lib/python/%(pyshortver)s/site-packages` gets replaced. This leads to duplicating this in many easyconfigs. Use the `custom_paths` argument for that but still honor if that is given from a child class. --- easybuild/easyblocks/generic/pythonpackage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/easybuild/easyblocks/generic/pythonpackage.py b/easybuild/easyblocks/generic/pythonpackage.py index 6318a88f67..8bf53a733a 100644 --- a/easybuild/easyblocks/generic/pythonpackage.py +++ b/easybuild/easyblocks/generic/pythonpackage.py @@ -1029,15 +1029,15 @@ def sanity_check_step(self, *args, **kwargs): else: self.log.debug("Detection of downloaded dependencies not enabled") - # inject directory path that uses %(pyshortver)s template into default value for sanity_check_paths, + # Use directory usually containg the python packages by default # but only for stand-alone installations, not for extensions; # this is relevant for installations of Python packages for multiple Python versions (via multi_deps) # (we can not pass this via custom_paths, since then the %(pyshortver)s template value will not be resolved) - if not self.is_extension and not self.cfg['sanity_check_paths'] and kwargs.get('custom_paths') is None: - self.cfg['sanity_check_paths'] = { + if not self.is_extension: + kwargs.setdefault('custom_paths', { 'files': [], 'dirs': [os.path.join('lib', 'python%(pyshortver)s', 'site-packages')], - } + }) # make sure 'exts_filter' is defined, which is used for sanity check if self.multi_python: From dbdbc325b97066335a70b8d930e182625a689c3d Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 11 Dec 2024 08:53:23 +0100 Subject: [PATCH 2/2] fix typo in comment --- easybuild/easyblocks/generic/pythonpackage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/generic/pythonpackage.py b/easybuild/easyblocks/generic/pythonpackage.py index 8bf53a733a..b72d53cc37 100644 --- a/easybuild/easyblocks/generic/pythonpackage.py +++ b/easybuild/easyblocks/generic/pythonpackage.py @@ -1029,7 +1029,7 @@ def sanity_check_step(self, *args, **kwargs): else: self.log.debug("Detection of downloaded dependencies not enabled") - # Use directory usually containg the python packages by default + # Use directory usually containing the python packages by default # but only for stand-alone installations, not for extensions; # this is relevant for installations of Python packages for multiple Python versions (via multi_deps) # (we can not pass this via custom_paths, since then the %(pyshortver)s template value will not be resolved)