diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2019-07-18 13:57:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-18 13:57:37 -0500 |
commit | c96d687c7c9fc1411e77fd1b7004fc80df8990c5 (patch) | |
tree | 3d6e0e556bb82b9137614df410b4844b4f3fa22d | |
parent | 620d728aa529d9a62c8a19b4b89af9920a363109 (diff) | |
download | spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.gz spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.bz2 spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.tar.xz spack-c96d687c7c9fc1411e77fd1b7004fc80df8990c5.zip |
Workaround for #9149 (#12050)
-rw-r--r-- | var/spack/repos/builtin/packages/py-numpy/package.py | 21 |
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 |