summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/concretize.py2
-rw-r--r--lib/spack/spack/package.py2
-rw-r--r--lib/spack/spack/spec.py2
-rw-r--r--lib/spack/spack/test/spec_dag.py9
4 files changed, 11 insertions, 4 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 62a180436b..520b003f74 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -701,7 +701,7 @@ def find_spec(spec, condition, default=None):
visited.add(id(relative))
# Then search all other relatives in the DAG *except* spec
- for relative in spec.root.traverse(deptypes=all):
+ for relative in spec.root.traverse(deptype='all'):
if relative is spec:
continue
if id(relative) in visited:
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 3bd52eb817..84c151bc99 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1189,7 +1189,7 @@ class PackageBase(six.with_metaclass(PackageMeta, PackageViewMixin, object)):
deps = []
# If the extendee is in the spec's deps already, return that.
- for dep in self.spec.traverse(deptypes=('link', 'run')):
+ for dep in self.spec.traverse(deptype=('link', 'run')):
if dep.name in self.extendees:
deps.append(dep)
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index bbcad6f746..ad7a460c4c 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -4272,7 +4272,7 @@ class Spec(object):
out = ""
for d, dep_spec in self.traverse_edges(
- order='pre', cover=cover, depth=True, deptypes=deptypes):
+ order='pre', cover=cover, depth=True, deptype=deptypes):
node = dep_spec.spec
if prefix is not None:
diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py
index ae2d413bb4..07b255eeb1 100644
--- a/lib/spack/spack/test/spec_dag.py
+++ b/lib/spack/spack/test/spec_dag.py
@@ -974,7 +974,6 @@ class TestSpecDag(object):
canonical_deptype(('foo',))
def test_invalid_literal_spec(self):
-
# Can't give type 'build' to a top-level spec
with pytest.raises(spack.spec.SpecParseError):
Spec.from_literal({'foo:build': None})
@@ -982,3 +981,11 @@ class TestSpecDag(object):
# Can't use more than one ':' separator
with pytest.raises(KeyError):
Spec.from_literal({'foo': {'bar:build:link': None}})
+
+ def test_spec_tree_respect_deptypes(self):
+ # Version-test-root uses version-test-pkg as a build dependency
+ s = Spec('version-test-root').concretized()
+ out = s.tree(deptypes='all')
+ assert 'version-test-pkg' in out
+ out = s.tree(deptypes=('link', 'run'))
+ assert 'version-test-pkg' not in out