fix dvc-objects/data imports

This commit is contained in:
Daniele Trifirò
2022-06-10 14:07:33 +05:45
committed by skshetry
parent a3ee993739
commit 677da2b22c
36 changed files with 61 additions and 61 deletions
+4 -4
View File
@@ -38,8 +38,8 @@ from dvc.testing.test_workspace import TestAdd
from dvc.utils import LARGE_DIR_SIZE, relpath
from dvc.utils.fs import path_isin
from dvc.utils.serialize import YAMLFileCorruptedError, load_yaml
from dvc_objects.hash import file_md5
from dvc_objects.hash_info import HashInfo
from dvc_objects.hashfile.hash import file_md5
from dvc_objects.hashfile.hash_info import HashInfo
from tests.basic_env import TestDvc
from tests.utils import get_gitignore_content
@@ -380,7 +380,7 @@ class TestDoubleAddUnchanged(TestDvc):
def test_should_update_state_entry_for_file_after_add(mocker, dvc, tmp_dir):
file_md5_counter = mocker.spy(dvc_objects.hash, "file_md5")
file_md5_counter = mocker.spy(dvc_objects.hashfile.hash, "file_md5")
tmp_dir.gen("foo", "foo")
ret = main(["config", "cache.type", "copy"])
@@ -411,7 +411,7 @@ def test_should_update_state_entry_for_file_after_add(mocker, dvc, tmp_dir):
def test_should_update_state_entry_for_directory_after_add(
mocker, dvc, tmp_dir
):
file_md5_counter = mocker.spy(dvc_objects.hash, "file_md5")
file_md5_counter = mocker.spy(dvc_objects.hashfile.hash, "file_md5")
tmp_dir.gen({"data/data": "foo", "data/data_sub/sub_data": "foo"})
+3 -3
View File
@@ -14,7 +14,7 @@ from dvc.testing.test_remote import ( # noqa, pylint: disable=unused-import
)
from dvc.utils.fs import remove
from dvc_data.db.local import LocalObjectDB
from dvc_objects.db import ObjectDB
from dvc_objects.hashfile.db import ObjectDB
def test_cloud_cli(tmp_dir, dvc, remote, mocker):
@@ -149,7 +149,7 @@ def test_warn_on_outdated_stage(tmp_dir, dvc, local_remote, caplog):
def test_hash_recalculation(mocker, dvc, tmp_dir, local_remote):
tmp_dir.gen({"foo": "foo"})
test_file_md5 = mocker.spy(dvc_objects.hash, "file_md5")
test_file_md5 = mocker.spy(dvc_objects.hashfile.hash, "file_md5")
ret = main(["config", "cache.type", "hardlink"])
assert ret == 0
ret = main(["add", "foo"])
@@ -211,7 +211,7 @@ def test_verify_hashes(
remove("dir")
remove(dvc.odb.local.cache_dir)
hash_spy = mocker.spy(dvc_objects.hash, "file_md5")
hash_spy = mocker.spy(dvc_objects.hashfile.hash, "file_md5")
dvc.pull()
assert hash_spy.call_count == 0
+1 -1
View File
@@ -11,7 +11,7 @@ from dvc.repo import Repo
from dvc.testing.tmp_dir import TmpDir
from dvc.types import List
from dvc_data.stage import IgnoreInCollectedDirError
from dvc_objects.utils import get_mtime_and_size
from dvc_objects.hashfile.utils import get_mtime_and_size
def _to_pattern_info_list(str_list: List):
+1 -1
View File
@@ -6,7 +6,7 @@ import pytest
from git import GitCommandError
from dvc.exceptions import DvcException
from dvc_objects.hash import file_md5
from dvc_objects.hashfile.hash import file_md5
from tests.func.parsing.test_errors import escape_ansi
+1 -1
View File
@@ -10,7 +10,7 @@ from dvc.stage.utils import split_params_deps
from dvc.utils.fs import remove
from dvc.utils.serialize import dumps_yaml, parse_yaml_for_update
from dvc.utils.strictyaml import YAMLValidationError, make_relpath
from dvc_objects.hash_info import HashInfo
from dvc_objects.hashfile.hash_info import HashInfo
from tests.func.test_run_multistage import supported_params
FS_STRUCTURE = {
+1 -1
View File
@@ -8,7 +8,7 @@ from dvc.cli import main
from dvc.odbmgr import ODBManager
from dvc.utils import relpath
from dvc_objects.errors import ObjectFormatError
from dvc_objects.hash_info import HashInfo
from dvc_objects.hashfile.hash_info import HashInfo
def test_cache(tmp_dir, dvc):
+1 -1
View File
@@ -139,8 +139,8 @@ def test_upper_case_remote(tmp_dir, dvc, local_cloud):
def test_dir_hash_should_be_key_order_agnostic(tmp_dir, dvc):
from dvc_data.objects.tree import Tree
from dvc_data.stage import stage
from dvc_data.tree import Tree
tmp_dir.gen({"data": {"1": "1 content", "2": "2 content"}})
+1 -1
View File
@@ -258,7 +258,7 @@ def get_index(dvc, rev):
@pytest.mark.parametrize("rev", ["workspace", "HEAD"])
def test_used_objs(tmp_dir, scm, dvc, run_copy, rev):
from dvc_objects.hash_info import HashInfo
from dvc_objects.hashfile.hash_info import HashInfo
dvc.config["core"]["autostage"] = True
tmp_dir.dvc_gen({"dir": {"subdir": {"file": "file"}}, "foo": "foo"})
+2 -2
View File
@@ -21,7 +21,7 @@ from dvc.stage.exceptions import StageFileDoesNotExistError
from dvc.utils import relpath
from dvc.utils.fs import remove
from dvc.utils.serialize import dump_yaml, load_yaml
from dvc_objects.hash import file_md5
from dvc_objects.hashfile.hash import file_md5
from tests.basic_env import TestDvc
@@ -817,7 +817,7 @@ class TestReproAllPipelines(SingleStageRun, TestDvc):
),
]
from dvc_objects.state import StateNoop
from dvc_objects.hashfile.state import StateNoop
self.dvc.state = StateNoop()
+1 -1
View File
@@ -31,7 +31,7 @@ from dvc.stage.exceptions import (
StagePathOutsideError,
)
from dvc.utils.serialize import load_yaml
from dvc_objects.hash import file_md5
from dvc_objects.hashfile.hash import file_md5
from tests.basic_env import TestDvc, TestDvcGit
+1 -1
View File
@@ -343,7 +343,7 @@ def test_stage_dir_optimization(
tmp_dir, dvc, mocker, dry_run, expected_staging_contents
):
from dvc_data import stage
from dvc_data.tree import Tree
from dvc_data.objects.tree import Tree
tmp_dir.dvc_gen(
{
+3 -3
View File
@@ -2,9 +2,9 @@ import os
import re
from dvc.repo import Repo
from dvc_objects.hash import file_md5
from dvc_objects.hash_info import HashInfo
from dvc_objects.state import State
from dvc_objects.hashfile.hash import file_md5
from dvc_objects.hashfile.hash_info import HashInfo
from dvc_objects.hashfile.state import State
def test_state(tmp_dir, dvc):