Skip to content

Commit

Permalink
[bugfix] Set pythonpath to a fixed location relative to build path
Browse files Browse the repository at this point in the history
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: easybuilders/easybuild-easyconfigs#21078
  • Loading branch information
gkaf89 committed Nov 20, 2024
1 parent b9b242a commit ecbb3b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions easybuild/easyblocks/p/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from easybuild.framework.easyconfig import CUSTOM
from easybuild.framework.easyconfig.templates import PYPI_SOURCE
from easybuild.tools.build_log import EasyBuildError, print_warning
from easybuild.tools.config import build_option, ERROR, log_path, PYTHONPATH, EBPYTHONPREFIXES
from easybuild.tools.config import build_option, ERROR, PYTHONPATH, EBPYTHONPREFIXES
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
Expand Down Expand Up @@ -143,7 +143,8 @@ 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')
script_directory = 'etc'
self.pythonpath = os.path.join(script_directory, 'python')

ext_defaults = {
# Use PYPI_SOURCE as the default for source_urls of extensions.
Expand Down

0 comments on commit ecbb3b9

Please sign in to comment.