summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/packages/py-nose/package.py4
-rw-r--r--var/spack/packages/python/package.py17
2 files changed, 13 insertions, 8 deletions
diff --git a/var/spack/packages/py-nose/package.py b/var/spack/packages/py-nose/package.py
index 7bd7106b8c..6df84e831d 100644
--- a/var/spack/packages/py-nose/package.py
+++ b/var/spack/packages/py-nose/package.py
@@ -1,7 +1,9 @@
from spack import *
class PyNose(Package):
- """nose extends the test loading and running features of unittest, making it easier to write, find and run tests."""
+ """nose extends the test loading and running features of unittest,
+ making it easier to write, find and run tests."""
+
homepage = "https://pypi.python.org/pypi/nose"
url = "https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz"
diff --git a/var/spack/packages/python/package.py b/var/spack/packages/python/package.py
index 86b903bc23..a22bd54c82 100644
--- a/var/spack/packages/python/package.py
+++ b/var/spack/packages/python/package.py
@@ -1,5 +1,6 @@
from spack import *
import os
+import re
class Python(Package):
"""The Python programming language."""
@@ -59,19 +60,21 @@ class Python(Package):
mkdirp(module.site_packages_dir)
- def add_ignore_files(self, args):
+ def make_ignore(self, args):
"""Add some ignore files to activate/deactivate args."""
- ignore = set(args.get('ignore', ()))
- ignore.add(os.path.join(self.site_packages_dir, 'site.py'))
- ignore.add(os.path.join(self.site_packages_dir, 'site.pyc'))
- args.update(ignore=ignore)
+ orig_ignore = args.get('ignore', lambda f: False)
+ def ignore(filename):
+ return (re.search(r'/site\.pyc?$', filename) or
+ re.search(r'\.pth$', filename) or
+ orig_ignore(filename))
+ return ignore
def activate(self, ext_pkg, **args):
- self.add_ignore_files(args)
+ args.update(ignore=self.make_ignore(args))
super(Python, self).activate(ext_pkg, **args)
def deactivate(self, ext_pkg, **args):
- self.add_ignore_files(args)
+ args.update(ignore=self.make_ignore(args))
super(Python, self).deactivate(ext_pkg, **args)