dvc: use dvc-data 0.0.8

This commit is contained in:
Ruslan Kuprieiev
2022-06-17 22:08:33 +03:00
parent 4262e26a15
commit 2e21c92c4f
15 changed files with 13 additions and 143 deletions
+1 -24
View File
@@ -7,7 +7,6 @@ from dvc.dependency.base import DependencyDoesNotExistError
from dvc.dvcfile import PIPELINE_FILE
from dvc.output import OutputDoesNotExistError
from dvc.stage.exceptions import StageCommitError
from tests.utils import clean_staging
def test_commit_recursive(tmp_dir, dvc):
@@ -84,8 +83,6 @@ def test_commit_with_deps(tmp_dir, dvc, run_copy, run_kw):
assert foo_stage.outs[0].changed_cache()
assert stage.outs[0].changed_cache()
clean_staging()
dvc.commit(stage.path, with_deps=True)
assert not foo_stage.outs[0].changed_cache()
assert not stage.outs[0].changed_cache()
@@ -99,8 +96,6 @@ def test_commit_changed_md5(tmp_dir, dvc):
stage_file_content["md5"] = "1111111111"
(tmp_dir / stage.path).dump(stage_file_content)
clean_staging()
with pytest.raises(StageCommitError):
dvc.commit(stage.path)
@@ -113,7 +108,6 @@ def test_commit_no_exec(tmp_dir, dvc):
stage = dvc.run(
name="my", cmd="mycmd", deps=["dep"], outs=["out"], no_exec=True
)
clean_staging()
assert dvc.status(stage.path)
dvc.commit(stage.path, force=True)
@@ -127,7 +121,6 @@ def test_commit_granular_output(tmp_dir, dvc):
outs=["foo", "bar"],
no_commit=True,
)
clean_staging()
cache = tmp_dir / ".dvc" / "cache"
assert not list(cache.glob("*/*"))
@@ -141,7 +134,6 @@ def test_commit_granular_output(tmp_dir, dvc):
def test_commit_granular_output_file(tmp_dir, dvc):
tmp_dir.gen("foo", "foo")
dvc.add("foo", no_commit=True)
clean_staging()
dvc.commit("foo")
assert dvc.status() == {}
@@ -157,7 +149,6 @@ def test_commit_granular_output_dir(tmp_dir, dvc):
}
)
dvc.add("data", no_commit=True)
clean_staging()
dvc.commit("data")
assert dvc.status() == {}
@@ -173,37 +164,27 @@ def test_commit_granular_dir(tmp_dir, dvc):
}
)
dvc.add("data", no_commit=True)
clean_staging()
cache = tmp_dir / ".dvc" / "cache"
assert set(cache.glob("*/*")) == {
cache / "1a" / "ca2c799df82929bbdd976557975546",
}
assert set(cache.glob("*/*")) == set()
dvc.commit(os.path.join("data", "foo"))
assert set(cache.glob("*/*")) == {
cache / "1a" / "ca2c799df82929bbdd976557975546",
cache / "1a" / "ca2c799df82929bbdd976557975546.dir",
cache / "ac" / "bd18db4cc2f85cedef654fccc4a4d8",
}
clean_staging()
dvc.commit(os.path.join("data", "subdir"))
assert set(cache.glob("*/*")) == {
cache / "26" / "d6b64d96a660707412f523e8184b5f",
cache / "1a" / "ca2c799df82929bbdd976557975546",
cache / "1a" / "ca2c799df82929bbdd976557975546.dir",
cache / "ac" / "bd18db4cc2f85cedef654fccc4a4d8",
cache / "4c" / "e8d2a2cf314a52fa7f315ca37ca445",
cache / "68" / "dde2c3c4e7953c2290f176bbdc9a54",
}
clean_staging()
dvc.commit(os.path.join("data"))
assert set(cache.glob("*/*")) == {
cache / "26" / "d6b64d96a660707412f523e8184b5f",
cache / "1a" / "ca2c799df82929bbdd976557975546",
cache / "1a" / "ca2c799df82929bbdd976557975546.dir",
cache / "ac" / "bd18db4cc2f85cedef654fccc4a4d8",
cache / "4c" / "e8d2a2cf314a52fa7f315ca37ca445",
@@ -216,7 +197,6 @@ def test_commit_no_exec_missing_dep(tmp_dir, dvc):
stage = dvc.run(
name="my", cmd="mycmd", deps=["dep"], outs=["out"], no_exec=True
)
clean_staging()
assert dvc.status(stage.path)
with pytest.raises(DependencyDoesNotExistError):
@@ -225,7 +205,6 @@ def test_commit_no_exec_missing_dep(tmp_dir, dvc):
def test_commit_no_exec_missing_out(tmp_dir, dvc):
stage = dvc.run(name="my", cmd="mycmd", outs=["out"], no_exec=True)
clean_staging()
assert dvc.status(stage.path)
with pytest.raises(OutputDoesNotExistError):
@@ -235,7 +214,6 @@ def test_commit_no_exec_missing_out(tmp_dir, dvc):
def test_commit_pipeline_stage(tmp_dir, dvc, run_copy):
tmp_dir.gen("foo", "foo")
stage = run_copy("foo", "bar", no_commit=True, name="copy-foo-bar")
clean_staging()
assert dvc.status(stage.addressing)
assert dvc.commit(stage.addressing, force=True) == [stage]
assert not dvc.status(stage.addressing)
@@ -249,7 +227,6 @@ def test_commit_pipeline_stage(tmp_dir, dvc, run_copy):
def test_imported_entries_unchanged(tmp_dir, dvc, erepo_dir):
with erepo_dir.chdir():
erepo_dir.dvc_gen("file", "file content", "initial commit")
clean_staging()
stage = dvc.imp(os.fspath(erepo_dir), "file")