Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ def __init__(self, *args, **kwargs):
self.use_setup_py = False
self.determine_install_command()

# avoid that pip (ab)uses $HOME/.cache/pip
# cfr. https://pip.pypa.io/en/stable/reference/pip_install/#caching
env.setvar('XDG_CACHE_HOME', os.path.join(self.builddir, 'xdg-cache-home'))
self.log.info("Using %s as pip cache directory", os.environ['XDG_CACHE_HOME'])
# Users or sites may require using a virtualenv for user installations
# We need to disable this to be able to install into the modules
env.setvar('PIP_REQUIRE_VIRTUALENV', 'false')

def determine_install_command(self):
"""
Determine install command to use.
Expand Down Expand Up @@ -452,11 +460,6 @@ def determine_install_command(self):
if pip_no_index or (pip_no_index is None and self.cfg.get('download_dep_fail')):
self.cfg.update('installopts', '--no-index')

# avoid that pip (ab)uses $HOME/.cache/pip
# cfr. https://pip.pypa.io/en/stable/reference/pip_install/#caching
env.setvar('XDG_CACHE_HOME', tempfile.gettempdir())
self.log.info("Using %s as pip cache directory", os.environ['XDG_CACHE_HOME'])

else:
self.use_setup_py = True
self.install_cmd = SETUP_PY_INSTALL_CMD
Expand Down