From 4ce389d96ac4affbc0cf2dedc53f7aad198fdf54 Mon Sep 17 00:00:00 2001 From: Georgios Kafanas Date: Tue, 30 Jul 2024 10:41:49 +0200 Subject: [PATCH] [bugfix] Set `pythonpath` to a fixed location relative to build path The `pythonpath` variable in the `python.py` EasyBlock is used to create temporary directories to store build artifacts. However, there are 2 problems with the current definition of the `pythonpath` instance field: - it uses the log directory to store build artifacts, and - the functions that use `pythonpath` do not accept a full path. The `build_path()` function cannot be used instead of `log_path()` as the function provides a full path as well. Thus we opted to hard-code a relative path with respect to the build directory. Issue: https://github.com/easybuilders/easybuild-easyconfigs/issues/21078 --- easybuild/easyblocks/p/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index 3bbdfd709c..9d9255d83b 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -45,7 +45,7 @@ from easybuild.framework.easyconfig import CUSTOM from easybuild.framework.easyconfig.templates import TEMPLATE_CONSTANTS from easybuild.tools.build_log import EasyBuildError, print_warning -from easybuild.tools.config import build_option, ERROR, log_path +from easybuild.tools.config import build_option, ERROR from easybuild.tools.modules import get_software_libdir, get_software_root, get_software_version from easybuild.tools.filetools import apply_regex_substitutions, change_dir, mkdir from easybuild.tools.filetools import read_file, remove_dir, symlink, write_file @@ -145,7 +145,7 @@ def __init__(self, *args, **kwargs): self.pyshortver = '.'.join(self.version.split('.')[:2]) # Used for EBPYTHONPREFIXES handler script - self.pythonpath = os.path.join(log_path(), 'python') + self.pythonpath = os.path.join('easybuild', 'python') ext_defaults = { # Use PYPI_SOURCE as the default for source_urls of extensions.