dvc: rename pipelines.yaml -> dvc.yaml (#3710)

This commit is contained in:
Ruslan Kuprieiev
2020-04-30 18:19:51 +03:00
committed by GitHub
parent 71d156ac49
commit f9088e1c67
7 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -27,8 +27,8 @@ logger = logging.getLogger(__name__)
DVC_FILE = "Dvcfile"
DVC_FILE_SUFFIX = ".dvc"
PIPELINE_FILE = "pipelines.yaml"
PIPELINE_LOCK = "pipelines.lock"
PIPELINE_FILE = "dvc.yaml"
PIPELINE_LOCK = "dvc.lock"
class LockfileCorruptedError(DvcException):
+5 -5
View File
@@ -828,22 +828,22 @@ def test_pipeline_file_target_ops(tmp_dir, dvc, local_remote, run_copy):
assert len(recurse_list_dir(fspath_py35(local_remote))) == 3
clean(outs, dvc)
assert set(dvc.pull(["pipelines.yaml"])["added"]) == {"lorem2", "baz"}
assert set(dvc.pull(["dvc.yaml"])["added"]) == {"lorem2", "baz"}
clean(outs, dvc)
assert set(dvc.pull()["added"]) == set(outs)
# clean everything in remote and push
clean(local_remote.iterdir())
dvc.push(["pipelines.yaml:copy-ipsum-baz"])
dvc.push(["dvc.yaml:copy-ipsum-baz"])
assert len(recurse_list_dir(fspath_py35(local_remote))) == 1
clean(local_remote.iterdir())
dvc.push(["pipelines.yaml"])
dvc.push(["dvc.yaml"])
assert len(recurse_list_dir(fspath_py35(local_remote))) == 2
with pytest.raises(StageNotFound):
dvc.push(["pipelines.yaml:StageThatDoesNotExist"])
dvc.push(["dvc.yaml:StageThatDoesNotExist"])
with pytest.raises(StageNotFound):
dvc.pull(["pipelines.yaml:StageThatDoesNotExist"])
dvc.pull(["dvc.yaml:StageThatDoesNotExist"])
+8 -8
View File
@@ -278,20 +278,20 @@ def test_pipeline_list_show_multistage(tmp_dir, dvc, run_copy, caplog):
with caplog.at_level(logging.INFO, "dvc"):
command._show("foobar.dvc", False, False, False)
output = caplog.text.splitlines()
assert "pipelines.yaml:copy-foo-bar" in output[0]
assert "dvc.yaml:copy-foo-bar" in output[0]
assert "foobar.dvc" in output[1]
caplog.clear()
with caplog.at_level(logging.INFO, "dvc"):
command._show("pipelines.yaml:copy-foo-bar", False, False, False)
assert "pipelines.yaml:copy-foo-bar" in caplog.text
command._show("dvc.yaml:copy-foo-bar", False, False, False)
assert "dvc.yaml:copy-foo-bar" in caplog.text
assert "foobar.dvc" not in caplog.text
command = CmdPipelineList([])
caplog.clear()
with caplog.at_level(logging.INFO, "dvc"):
command.run()
assert "pipelines.yaml:copy-foo-bar" in caplog.text
assert "dvc.yaml:copy-foo-bar" in caplog.text
assert "foobar.dvc" in caplog.text
assert "1 pipelines in total"
@@ -302,10 +302,10 @@ def test_pipeline_ascii_multistage(tmp_dir, dvc, run_copy):
run_copy("bar", "foobar")
command = CmdPipelineShow([])
nodes, edges, is_tree = command._build_graph("foobar.dvc")
assert set(nodes) == {"pipelines.yaml:copy-foo-bar", "foobar.dvc"}
assert set(nodes) == {"dvc.yaml:copy-foo-bar", "foobar.dvc"}
assert set(edges) == {
("foobar.dvc", "pipelines.yaml:copy-foo-bar"),
("foobar.dvc", "dvc.yaml:copy-foo-bar"),
}
nodes, edges, is_tree = command._build_graph("pipelines.yaml:copy-foo-bar")
assert set(nodes) == {"pipelines.yaml:copy-foo-bar"}
nodes, edges, is_tree = command._build_graph("dvc.yaml:copy-foo-bar")
assert set(nodes) == {"dvc.yaml:copy-foo-bar"}
+3 -3
View File
@@ -86,13 +86,13 @@ def test_collect(tmp_dir, scm, dvc, run_copy):
"foobar",
"foo",
}
assert collect_outs("pipelines.yaml:copy-foo-foobar", recursive=True) == {
assert collect_outs("dvc.yaml:copy-foo-foobar", recursive=True) == {
"foobar"
}
run_copy("foobar", "baz", name="copy-foobar-baz")
assert collect_outs("pipelines.yaml") == {"foobar", "baz"}
assert collect_outs("pipelines.yaml", with_deps=True) == {
assert collect_outs("dvc.yaml") == {"foobar", "baz"}
assert collect_outs("dvc.yaml", with_deps=True) == {
"foobar",
"baz",
"foo",
+1 -1
View File
@@ -200,7 +200,7 @@ def test_stage_addressing(tmp_dir, dvc, run_copy):
assert stage1.addressing == "bar.dvc"
stage2 = run_copy("bar", "baz", name="copy-bar-baz")
assert stage2.addressing == "pipelines.yaml:copy-bar-baz"
assert stage2.addressing == "dvc.yaml:copy-bar-baz"
folder = tmp_dir / "dir"
folder.mkdir()
+3 -3
View File
@@ -74,12 +74,12 @@ def test_status_on_pipeline_stages(tmp_dir, dvc, run_copy):
stage.cmd = " ".join(stage.cmd.split())
stage.dvcfile._dump_pipeline_file(stage)
assert dvc.status() == {"pipelines.yaml:copy-foo-bar": ["changed command"]}
assert dvc.status() == {"dvc.yaml:copy-foo-bar": ["changed command"]}
# delete outputs
(tmp_dir / "bar").unlink()
assert dvc.status() == {
"pipelines.yaml:copy-foo-bar": [
"dvc.yaml:copy-foo-bar": [
{"changed outs": {"bar": "deleted"}},
"changed command",
]
@@ -87,7 +87,7 @@ def test_status_on_pipeline_stages(tmp_dir, dvc, run_copy):
(tmp_dir / "foo").unlink()
assert dvc.status() == {
"foo.dvc": [{"changed outs": {"foo": "deleted"}}],
"pipelines.yaml:copy-foo-bar": [
"dvc.yaml:copy-foo-bar": [
{"changed deps": {"foo": "deleted"}},
{"changed outs": {"bar": "deleted"}},
"changed command",
+6 -6
View File
@@ -138,11 +138,11 @@ def test_resolve_output(inp, out, is_dir, expected, mocker):
@pytest.mark.parametrize(
"inp,out, default",
[
["pipelines.yaml", ("pipelines.yaml", None), None],
["pipelines.yaml:name", ("pipelines.yaml", "name"), None],
[":name", ("pipelines.yaml", "name"), None],
["dvc.yaml", ("dvc.yaml", None), None],
["dvc.yaml:name", ("dvc.yaml", "name"), None],
[":name", ("dvc.yaml", "name"), None],
["stage.dvc", ("stage.dvc", None), None],
["pipelines.yaml:name", ("pipelines.yaml", "name"), None],
["dvc.yaml:name", ("dvc.yaml", "name"), None],
["../models/stage.dvc", ("../models/stage.dvc", None), "def"],
[":name", ("default", "name"), "default"],
[":name", ("default", "name"), "default"],
@@ -154,8 +154,8 @@ def test_parse_target(inp, out, default):
def test_hint_on_lockfile():
with pytest.raises(Exception) as exc:
assert parse_target("pipelines.lock:name")
assert "pipelines.yaml:name" in str(exc.value)
assert parse_target("dvc.lock:name")
assert "dvc.yaml:name" in str(exc.value)
@pytest.mark.parametrize(