mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 23:09:32 +01:00
+11
-16
@@ -48,26 +48,21 @@ class CmdPipelineShow(CmdBase):
|
||||
elif outs:
|
||||
for out in stage.outs:
|
||||
nodes.add(str(out))
|
||||
for dep in stage.deps:
|
||||
nodes.add(str(dep))
|
||||
else:
|
||||
nodes.add(stage.relpath)
|
||||
|
||||
edges = []
|
||||
|
||||
if outs:
|
||||
for stage in networkx.dfs_preorder_nodes(G, target_stage):
|
||||
for dep in stage.deps:
|
||||
for out in stage.outs:
|
||||
edges.append((str(out), str(dep)))
|
||||
else:
|
||||
for from_stage, to_stage in networkx.edge_dfs(G, target_stage):
|
||||
if commands:
|
||||
if to_stage.cmd is None:
|
||||
continue
|
||||
edges.append((from_stage.cmd, to_stage.cmd))
|
||||
else:
|
||||
edges.append((from_stage.relpath, to_stage.relpath))
|
||||
for from_stage, to_stage in networkx.edge_dfs(G, target_stage):
|
||||
if commands:
|
||||
if to_stage.cmd is None:
|
||||
continue
|
||||
edges.append((from_stage.cmd, to_stage.cmd))
|
||||
elif outs:
|
||||
for from_out in from_stage.outs:
|
||||
for to_out in to_stage.outs:
|
||||
edges.append((str(from_out), str(to_out)))
|
||||
else:
|
||||
edges.append((from_stage.relpath, to_stage.relpath))
|
||||
|
||||
return list(nodes), edges, networkx.is_tree(G)
|
||||
|
||||
|
||||
@@ -239,15 +239,18 @@ class TestDvcRepoPipeline(TestDvc):
|
||||
self.assertEqual(len(pipelines), 0)
|
||||
|
||||
|
||||
def test_split_pipeline(tmp_dir, dvc):
|
||||
def test_split_pipeline(tmp_dir, scm, dvc):
|
||||
tmp_dir.scm_gen("git_dep1", "git_dep1")
|
||||
tmp_dir.scm_gen("git_dep2", "git_dep2")
|
||||
|
||||
tmp_dir.dvc_gen("data", "source file content")
|
||||
dvc.run(
|
||||
deps=["data"],
|
||||
deps=["git_dep1", "data"],
|
||||
outs=["data_train", "data_valid"],
|
||||
cmd="echo train >> data_train && echo valid >> data_valid",
|
||||
)
|
||||
stage = dvc.run(
|
||||
deps=["data_train", "data_valid"],
|
||||
deps=["git_dep2", "data_train", "data_valid"],
|
||||
outs=["result"],
|
||||
cmd="echo result >> result",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user