summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-03-17 18:22:07 +0100
committeralalazo <massimiliano.culpo@googlemail.com>2016-03-17 18:22:07 +0100
commitac394718ec0aa67c468a8529b930eaade0bcbed1 (patch)
tree712cf771b038f9114e1b8b1a9ffc4fa548db554a
parente673127263a03e63d6a64840d1071a788f0c099e (diff)
downloadspack-ac394718ec0aa67c468a8529b930eaade0bcbed1.tar.gz
spack-ac394718ec0aa67c468a8529b930eaade0bcbed1.tar.bz2
spack-ac394718ec0aa67c468a8529b930eaade0bcbed1.tar.xz
spack-ac394718ec0aa67c468a8529b930eaade0bcbed1.zip
python : implemented possible solution
-rw-r--r--lib/spack/spack/package.py11
-rw-r--r--var/spack/repos/builtin/packages/py-nose/package.py3
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index d0b94dbbeb..a7ab20137e 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -37,6 +37,7 @@ import os
import re
import textwrap
import time
+import glob
import llnl.util.tty as tty
import spack
@@ -55,7 +56,6 @@ from llnl.util.filesystem import *
from llnl.util.lang import *
from llnl.util.link_tree import LinkTree
from llnl.util.tty.log import log_output
-from spack.environment import EnvironmentModifications
from spack.stage import Stage, ResourceStage, StageComposite
from spack.util.compression import allowed_archive
from spack.util.environment import dump_environment
@@ -1236,6 +1236,15 @@ class Package(object):
return " ".join("-Wl,-rpath,%s" % p for p in self.rpath)
+class PythonExtension(Package):
+ def setup_dependent_environment(self, env, dependent_spec):
+ pass
+
+ def setup_environment(self, env):
+ site_packages = glob.glob(join_path(self.spec.prefix.lib, "python*/site-packages"))
+ if site_packages:
+ env.prepend_path('PYTHONPATH', site_packages[0])
+
def validate_package_url(url_string):
"""Determine whether spack can handle a particular URL or not."""
url = urlparse(url_string)
diff --git a/var/spack/repos/builtin/packages/py-nose/package.py b/var/spack/repos/builtin/packages/py-nose/package.py
index e7c6cf0264..e817b8eb51 100644
--- a/var/spack/repos/builtin/packages/py-nose/package.py
+++ b/var/spack/repos/builtin/packages/py-nose/package.py
@@ -1,6 +1,7 @@
from spack import *
+from spack.package import PythonExtension
-class PyNose(Package):
+class PyNose(PythonExtension):
"""nose extends the test loading and running features of unittest,
making it easier to write, find and run tests."""