summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/graph.py2
-rw-r--r--lib/spack/spack/test/spec_dag.py21
2 files changed, 11 insertions, 12 deletions
diff --git a/lib/spack/spack/graph.py b/lib/spack/spack/graph.py
index 6a80c7d472..5ecd40bd3d 100644
--- a/lib/spack/spack/graph.py
+++ b/lib/spack/spack/graph.py
@@ -94,7 +94,7 @@ def topological_sort(spec, **kwargs):
nodes = spec.index()
topo_order = []
- par = {name: parents(nodes[name]) for name in nodes.keys()}
+ par = dict((name, parents(nodes[name])) for name in nodes.keys())
remaining = [name for name in nodes.keys() if not parents(nodes[name])]
heapify(remaining)
diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py
index 972e79aa20..fd57a4ea4b 100644
--- a/lib/spack/spack/test/spec_dag.py
+++ b/lib/spack/spack/test/spec_dag.py
@@ -476,20 +476,20 @@ class SpecDagTest(MockPackagesTest):
dag = Spec('dtuse')
dag.normalize()
- names = ['dtuse', 'dttop', 'dtlink1', 'dtlink3', 'dtlink4',
- 'dtrun1', 'dtlink5', 'dtrun3']
+ names = ['dtuse', 'dttop', 'dtbuild1', 'dtbuild2', 'dtlink2',
+ 'dtlink1', 'dtlink3', 'dtlink4']
- traversal = dag.traverse()
+ traversal = dag.traverse(deptype=('build', 'link'))
self.assertEqual([x.name for x in traversal], names)
def test_deptype_traversal_with_builddeps(self):
dag = Spec('dttop')
dag.normalize()
- names = ['dttop', 'dtbuild1', 'dtlink2', 'dtrun2', 'dtlink1',
- 'dtlink3', 'dtlink4', 'dtrun1', 'dtlink5', 'dtrun3']
+ names = ['dttop', 'dtbuild1', 'dtbuild2', 'dtlink2',
+ 'dtlink1', 'dtlink3', 'dtlink4']
- traversal = dag.traverse()
+ traversal = dag.traverse(deptype=('build', 'link'))
self.assertEqual([x.name for x in traversal], names)
def test_deptype_traversal_full(self):
@@ -500,15 +500,14 @@ class SpecDagTest(MockPackagesTest):
'dtlink1', 'dtlink3', 'dtlink4', 'dtrun1', 'dtlink5',
'dtrun3', 'dtbuild3']
- traversal = dag.traverse(deptype_query=spack.alldeps)
+ traversal = dag.traverse(deptype=spack.alldeps)
self.assertEqual([x.name for x in traversal], names)
- def test_deptype_traversal_pythonpath(self):
+ def test_deptype_traversal_run(self):
dag = Spec('dttop')
dag.normalize()
- names = ['dttop', 'dtbuild1', 'dtrun2', 'dtlink1', 'dtrun1',
- 'dtrun3']
+ names = ['dttop', 'dtrun1', 'dtrun3']
- traversal = dag.traverse(deptype=spack.nolink, deptype_query='run')
+ traversal = dag.traverse(deptype='run')
self.assertEqual([x.name for x in traversal], names)