[!13] Make sure that the python directories are in the user space

Merge branch 'feature/user-space-python-directories' into 'master'

See merge request [spack/dune-spack!13]

  [spack/dune-spack!13]: Nonespack/dune-spack/merge_requests/13
This commit is contained in:
Dominic Kempf 2020-05-18 11:00:04 +00:00
commit 493d25b065
2 changed files with 5 additions and 4 deletions

View File

@ -11,8 +11,8 @@ RUN export DEBIAN_FRONTEND=noninteractive; \
ca-certificates \
git \
procps \
python \
python-dev \
python3 \
python3-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
ARG version=master

View File

@ -21,6 +21,7 @@
# ----------------------------------------------------------------------------
import os
from pathlib import Path
from spack import *
@ -223,12 +224,12 @@ class Dune(CMakePackage):
# Additionally, we need to set the workspace for the Python bindings to something
# that is unique to this build of the dune module (it defaults to ~/.cache)
if '+python' in self.spec:
env.set('DUNE_PY_DIR', self.prefix)
env.set('DUNE_PY_DIR', join_path(Path.home(), '.cache', 'dune-py', self.spec.dag_hash()))
# For those modules that typically work with the Dune Virtualenv,
# we export the location of the virtualenv as an environment variable.
if '+testtools' in self.spec:
env.set('DUNE_PYTHON_VIRTUALENV_PATH', join_path(self.prefix, 'dune-python-env'))
env.set('DUNE_PYTHON_VIRTUALENV_PATH', join_path(Path.home(), '.cache', 'dune-python-env', self.spec.dag_hash()))
def cmake_args(self):
"""Populate cmake arguments."""