summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-01-10 19:52:07 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2015-02-02 11:19:53 -0800
commitd13bbeb605f56214db919f6f122a8fa6ba67ddbc (patch)
tree97f6a24b14f7a0580df35717f97fd8c1f94fbe36 /lib
parentbcccf020204a556e382c0af2897ad9126bb24984 (diff)
downloadspack-d13bbeb605f56214db919f6f122a8fa6ba67ddbc.tar.gz
spack-d13bbeb605f56214db919f6f122a8fa6ba67ddbc.tar.bz2
spack-d13bbeb605f56214db919f6f122a8fa6ba67ddbc.tar.xz
spack-d13bbeb605f56214db919f6f122a8fa6ba67ddbc.zip
Add PYTOHNPATH to modules for python extensions.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/modules.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/spack/spack/modules.py b/lib/spack/spack/modules.py
index 755e9ea900..7d2ca97a62 100644
--- a/lib/spack/spack/modules.py
+++ b/lib/spack/spack/modules.py
@@ -49,6 +49,7 @@ import os
import re
import textwrap
import shutil
+from glob import glob
from contextlib import closing
import llnl.util.tty as tty
@@ -123,6 +124,13 @@ class EnvModule(object):
if os.path.isdir(directory):
add_path(var, directory)
+ # Add python path unless it's an actual python installation
+ # TODO: is there a better way to do this?
+ if self.spec.name != 'python':
+ site_packages = glob(join_path(self.spec.prefix.lib, "python*/site-packages"))
+ if site_packages:
+ add_path('PYTHONPATH', site_packages[0])
+
# short description is just the package + version
# TODO: maybe packages can optionally provide it.
self.short_description = self.spec.format("$_ $@")