diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-03-02 08:43:26 +0100 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-04-14 11:08:17 +0200 |
commit | fbdcd7cbf178e1dc6ec597c1a35944d527026dda (patch) | |
tree | 62b1e912229d8cab94ce31a532c661a9242da6d4 | |
parent | 5b0d4fe928a6cab7257b8949a0be4b61d6d1951a (diff) | |
download | spack-fbdcd7cbf178e1dc6ec597c1a35944d527026dda.tar.gz spack-fbdcd7cbf178e1dc6ec597c1a35944d527026dda.tar.bz2 spack-fbdcd7cbf178e1dc6ec597c1a35944d527026dda.tar.xz spack-fbdcd7cbf178e1dc6ec597c1a35944d527026dda.zip |
Fix typos when forwarding arguments to traverse_edges (#29261)
A few calls use `deptypes=...` instead of `deptype=...`
-rw-r--r-- | lib/spack/spack/concretize.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/package.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/spec.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/spec_dag.py | 9 |
4 files changed, 11 insertions, 4 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py index f3572cfdcf..cd66dccfc6 100644 --- a/lib/spack/spack/concretize.py +++ b/lib/spack/spack/concretize.py @@ -685,7 +685,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 8e1e81c124..a972350f98 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1182,7 +1182,7 @@ class PackageBase(six.with_metaclass(PackageMeta, PackageViewMixin, object)): name = next(iter(self.extendees)) # 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 name == dep.name: return dep diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index eaf7544e83..9e2a2ec929 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -4259,7 +4259,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 4f57dd818d..416ef8ff33 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 |