summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2019-07-18 13:57:37 -0500
committerGitHub <noreply@github.com>2019-07-18 13:57:37 -0500
commitc96d687c7c9fc1411e77fd1b7004fc80df8990c5 (patch)
tree3d6e0e556bb82b9137614df410b4844b4f3fa22d /var
parent620d728aa529d9a62c8a19b4b89af9920a363109 (diff)
downloadspack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.gz
spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.bz2
spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.xz
spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.zip
Workaround for #9149 (#12050)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-numpy/package.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py
index 0054dfadbc..e4385985f7 100644
--- a/var/spack/repos/builtin/packages/py-numpy/package.py
+++ b/var/spack/repos/builtin/packages/py-numpy/package.py
@@ -201,15 +201,18 @@ class PyNumpy(PythonPackage):
return args
def setup_environment(self, spack_env, run_env):
- python_version = self.spec['python'].version.up_to(2)
-
- include_path = join_path(
- self.prefix.lib,
- 'python{0}'.format(python_version),
- 'site-packages',
- 'numpy/core/include')
-
- run_env.prepend_path('CPATH', include_path)
+ # If py-numpy is installed as an external package, python won't
+ # be available in the spec. See #9149 for details.
+ if 'python' in self.spec:
+ python_version = self.spec['python'].version.up_to(2)
+
+ include_path = join_path(
+ self.prefix.lib,
+ 'python{0}'.format(python_version),
+ 'site-packages',
+ 'numpy/core/include')
+
+ run_env.prepend_path('CPATH', include_path)
def test(self):
# `setup.py test` is not supported. Use one of the following