mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
+1
-1
@@ -107,7 +107,7 @@ def _log_exceptions(exc: Exception) -> Optional[int]:
|
||||
)
|
||||
return 251
|
||||
|
||||
from dvc_objects.hashfile.cache import DiskError
|
||||
from dvc_objects.cache import DiskError
|
||||
|
||||
if isinstance(exc, DiskError):
|
||||
from dvc.utils import relpath
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ from dvc_data.db import get_index
|
||||
if TYPE_CHECKING:
|
||||
from dvc_data.status import CompareStatusResult
|
||||
from dvc_objects.db import ObjectDB
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from voluptuous import Any
|
||||
|
||||
from dvc.exceptions import DvcException
|
||||
from dvc.utils.serialize import LOADERS, ParseError
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
from .base import Dependency
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ from .base import Dependency
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from dvc_objects.db import ObjectDB
|
||||
from dvc_objects.hashfile.file import HashFile
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.file import HashFile
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
class RepoDependency(Dependency):
|
||||
@@ -103,8 +103,8 @@ class RepoDependency(Dependency):
|
||||
from dvc.config import NoRemoteError
|
||||
from dvc.exceptions import NoOutputOrStageError, PathMissingError
|
||||
from dvc.utils import as_posix
|
||||
from dvc_data.objects.tree import Tree, TreeError
|
||||
from dvc_data.stage import stage
|
||||
from dvc_data.tree import Tree, TreeError
|
||||
|
||||
local_odb = self.repo.odb.local
|
||||
locked = kwargs.pop("locked", True)
|
||||
@@ -156,7 +156,7 @@ class RepoDependency(Dependency):
|
||||
from dvc.exceptions import CircularImportError
|
||||
from dvc.fs.dvc import DvcFileSystem
|
||||
from dvc_data.db.reference import ReferenceObjectDB
|
||||
from dvc_data.objects.tree import Tree
|
||||
from dvc_data.tree import Tree
|
||||
|
||||
if not isinstance(odb, ReferenceObjectDB):
|
||||
return
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ class _DataFileSystem(AbstractFileSystem): # pylint:disable=abstract-method
|
||||
return bool(info.get("outs") if recurse else info.get("isout"))
|
||||
|
||||
def info(self, path, **kwargs):
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
key = self._get_key(path)
|
||||
|
||||
|
||||
+6
-6
@@ -17,16 +17,16 @@ from dvc.exceptions import (
|
||||
MergeError,
|
||||
RemoteCacheRequiredError,
|
||||
)
|
||||
from dvc_data import Tree
|
||||
from dvc_data import check as ocheck
|
||||
from dvc_data import load as oload
|
||||
from dvc_data.checkout import checkout
|
||||
from dvc_data.stage import stage as ostage
|
||||
from dvc_data.transfer import transfer as otransfer
|
||||
from dvc_data.tree import Tree
|
||||
from dvc_objects.errors import ObjectFormatError
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hashfile.istextfile import istextfile
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from dvc_objects.istextfile import istextfile
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
from .fs import (
|
||||
HDFSFileSystem,
|
||||
@@ -1044,8 +1044,8 @@ class Output:
|
||||
)
|
||||
|
||||
def merge(self, ancestor, other):
|
||||
from dvc_data.objects.tree import MergeError as TreeMergeError
|
||||
from dvc_data.objects.tree import du, merge
|
||||
from dvc_data.tree import MergeError as TreeMergeError
|
||||
from dvc_data.tree import du, merge
|
||||
|
||||
assert other
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
||||
from dvc.fs import FileSystem
|
||||
from dvc.repo.scm_context import SCMContext
|
||||
from dvc.scm import Base
|
||||
from dvc_objects.hashfile.file import HashFile
|
||||
from dvc_objects.file import HashFile
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -165,7 +165,7 @@ class Repo:
|
||||
from dvc.repo.stage import StageLoad
|
||||
from dvc.scm import SCM
|
||||
from dvc.stage.cache import StageCache
|
||||
from dvc_objects.hashfile.state import State, StateNoop
|
||||
from dvc_objects.state import State, StateNoop
|
||||
|
||||
self.url = url
|
||||
self._fs_conf = {"repo_factory": repo_factory}
|
||||
|
||||
+3
-3
@@ -25,9 +25,9 @@ if TYPE_CHECKING:
|
||||
from dvc.repo.stage import StageLoad
|
||||
from dvc.stage import Stage
|
||||
from dvc.types import StrPath, TargetType
|
||||
from dvc_data import Tree
|
||||
from dvc_data.tree import Tree
|
||||
from dvc_objects.db import ObjectDB
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
ObjectContainer = Dict[Optional["ObjectDB"], Set["HashInfo"]]
|
||||
@@ -170,7 +170,7 @@ class Index:
|
||||
@cached_property
|
||||
def tree(self) -> "Tree":
|
||||
from dvc.config import NoRemoteError
|
||||
from dvc_data import Tree
|
||||
from dvc_data.tree import Tree
|
||||
|
||||
tree = Tree(None, None, None)
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ from dvc.output import CHECKSUMS_SCHEMA, Output
|
||||
from dvc.parsing import DO_KWD, FOREACH_KWD, VARS_KWD
|
||||
from dvc.parsing.versions import SCHEMA_KWD, lockfile_version_schema
|
||||
from dvc.stage.params import StageParams
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
STAGES = "stages"
|
||||
SINGLE_STAGE_SCHEMA = {
|
||||
|
||||
@@ -37,7 +37,7 @@ from .utils import (
|
||||
if TYPE_CHECKING:
|
||||
from dvc.dvcfile import DVCFile
|
||||
from dvc_objects.db.base import ObjectDB
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
# Disallow all punctuation characters except hyphen and underscore
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class RunCacheNotFoundError(DvcException):
|
||||
|
||||
|
||||
def _get_cache_hash(cache, key=False):
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
if key:
|
||||
cache["outs"] = [out["path"] for out in cache.get("outs", [])]
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ from funcy import cached_property, get_in, lcat, once, project
|
||||
from dvc import dependency, output
|
||||
from dvc.parsing import FOREACH_KWD, JOIN, DataResolver, EntryNotFound
|
||||
from dvc.parsing.versions import LOCKFILE_VERSION
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
from . import PipelineStage, Stage, loads_from
|
||||
from .exceptions import StageNameUnspecified, StageNotFound
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Union
|
||||
from funcy import concat, first, lsplit, rpartial, without
|
||||
|
||||
from dvc.exceptions import InvalidArgumentError
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
from .exceptions import (
|
||||
MissingDataSource,
|
||||
|
||||
@@ -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.hashfile.hash import file_md5
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash import file_md5
|
||||
from dvc_objects.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.hashfile.hash, "file_md5")
|
||||
file_md5_counter = mocker.spy(dvc_objects.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.hashfile.hash, "file_md5")
|
||||
file_md5_counter = mocker.spy(dvc_objects.hash, "file_md5")
|
||||
|
||||
tmp_dir.gen({"data/data": "foo", "data/data_sub/sub_data": "foo"})
|
||||
|
||||
|
||||
@@ -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.hashfile.db import ObjectDB
|
||||
from dvc_objects.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.hashfile.hash, "file_md5")
|
||||
test_file_md5 = mocker.spy(dvc_objects.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.hashfile.hash, "file_md5")
|
||||
hash_spy = mocker.spy(dvc_objects.hash, "file_md5")
|
||||
|
||||
dvc.pull()
|
||||
assert hash_spy.call_count == 0
|
||||
|
||||
@@ -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.hashfile.utils import get_mtime_and_size
|
||||
from dvc_objects.utils import get_mtime_and_size
|
||||
|
||||
|
||||
def _to_pattern_info_list(str_list: List):
|
||||
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
from git import GitCommandError
|
||||
|
||||
from dvc.exceptions import DvcException
|
||||
from dvc_objects.hashfile.hash import file_md5
|
||||
from dvc_objects.hash import file_md5
|
||||
from tests.func.parsing.test_errors import escape_ansi
|
||||
|
||||
|
||||
|
||||
@@ -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.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from tests.func.test_run_multistage import supported_params
|
||||
|
||||
FS_STRUCTURE = {
|
||||
|
||||
@@ -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.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
def test_cache(tmp_dir, dvc):
|
||||
|
||||
@@ -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"}})
|
||||
|
||||
|
||||
@@ -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.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
dvc.config["core"]["autostage"] = True
|
||||
tmp_dir.dvc_gen({"dir": {"subdir": {"file": "file"}}, "foo": "foo"})
|
||||
|
||||
@@ -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.hashfile.hash import file_md5
|
||||
from dvc_objects.hash import file_md5
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
@@ -817,7 +817,7 @@ class TestReproAllPipelines(SingleStageRun, TestDvc):
|
||||
),
|
||||
]
|
||||
|
||||
from dvc_objects.hashfile.state import StateNoop
|
||||
from dvc_objects.state import StateNoop
|
||||
|
||||
self.dvc.state = StateNoop()
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ from dvc.stage.exceptions import (
|
||||
StagePathOutsideError,
|
||||
)
|
||||
from dvc.utils.serialize import load_yaml
|
||||
from dvc_objects.hashfile.hash import file_md5
|
||||
from dvc_objects.hash import file_md5
|
||||
from tests.basic_env import TestDvc, TestDvcGit
|
||||
|
||||
|
||||
|
||||
@@ -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.objects.tree import Tree
|
||||
from dvc_data.tree import Tree
|
||||
|
||||
tmp_dir.dvc_gen(
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@ import os
|
||||
import re
|
||||
|
||||
from dvc.repo import Repo
|
||||
from dvc_objects.hashfile.hash import file_md5
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hashfile.state import State
|
||||
from dvc_objects.hash import file_md5
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from dvc_objects.state import State
|
||||
|
||||
|
||||
def test_state(tmp_dir, dvc):
|
||||
|
||||
@@ -5,8 +5,8 @@ from funcy import raiser
|
||||
|
||||
from dvc.cli import main
|
||||
from dvc_data.stage import IgnoreInCollectedDirError
|
||||
from dvc_objects.cache import DiskError
|
||||
from dvc_objects.fs.base import FileSystem, RemoteMissingDepsError
|
||||
from dvc_objects.hashfile.cache import DiskError
|
||||
|
||||
|
||||
def test_state_pickle_errors_are_correctly_raised(tmp_dir, caplog, mocker):
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from dvc.fs import LocalFileSystem
|
||||
from dvc_data.db.local import LocalObjectDB
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
def test_status_download_optimization(mocker, dvc):
|
||||
|
||||
@@ -2,9 +2,9 @@ from operator import itemgetter
|
||||
|
||||
import pytest
|
||||
|
||||
from dvc_data.objects.tree import Tree, _merge
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_data.tree import Tree, _merge
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from dvc_objects.meta import Meta
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -8,7 +8,7 @@ from dvc.config import NoRemoteError
|
||||
from dvc.fs.data import DataFileSystem
|
||||
from dvc.utils.fs import remove
|
||||
from dvc_data.stage import stage
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -231,7 +231,7 @@ def test_get_hash_dir(tmp_dir, dvc, mocker):
|
||||
{"dir": {"foo": "foo", "bar": "bar", "subdir": {"data": "data"}}}
|
||||
)
|
||||
fs = DataFileSystem(repo=dvc)
|
||||
hash_file_spy = mocker.spy(dvc_objects.hashfile.hash, "hash_file")
|
||||
hash_file_spy = mocker.spy(dvc_objects.hash, "hash_file")
|
||||
assert fs.info("dir")["md5"] == "8761c4e9acad696bee718615e23e22db.dir"
|
||||
assert not hash_file_spy.called
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import pytest
|
||||
|
||||
from dvc.fs.dvc import DvcFileSystem
|
||||
from dvc_data.stage import stage
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from tests.utils import clean_staging
|
||||
|
||||
|
||||
@@ -577,7 +577,7 @@ def test_get_hash_mixed_dir(tmp_dir, scm, dvc):
|
||||
def test_get_hash_dirty_file(tmp_dir, dvc):
|
||||
from dvc_data import check
|
||||
from dvc_objects.errors import ObjectFormatError
|
||||
from dvc_objects.hashfile.hash import hash_file
|
||||
from dvc_objects.hash import hash_file
|
||||
|
||||
tmp_dir.dvc_gen("file", "file")
|
||||
file_hash_info = HashInfo("md5", "8c7dd922ad47494fc02c388e12c00eac")
|
||||
|
||||
@@ -4,8 +4,8 @@ from unittest.mock import patch
|
||||
from dvc.output import Output
|
||||
from dvc.stage import Stage
|
||||
from dvc.utils import relpath
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hashfile.meta import Meta
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
from dvc_objects.meta import Meta
|
||||
from tests.basic_env import TestDvc
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import posixpath
|
||||
from unittest import mock
|
||||
|
||||
from dvc.fs import FileSystem
|
||||
from dvc_objects.hashfile.db import ObjectDB
|
||||
from dvc_objects.db import ObjectDB
|
||||
|
||||
|
||||
class _CallableOrNone:
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from dvc.exceptions import OutputDuplicationError
|
||||
from dvc.repo import NotDvcRepoError, Repo, locked
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
def test_is_dvc_internal(dvc):
|
||||
|
||||
@@ -8,7 +8,7 @@ from dvc.dvcfile import PIPELINE_FILE, Dvcfile
|
||||
from dvc.stage import PipelineStage, create_stage
|
||||
from dvc.stage.loader import StageLoader
|
||||
from dvc.stage.serialize import split_params_deps
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -11,7 +11,7 @@ from dvc.stage.serialize import (
|
||||
to_single_stage_lockfile as _to_single_stage_lockfile,
|
||||
)
|
||||
from dvc.stage.utils import split_params_deps
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
kwargs = {"name": "something", "cmd": "command", "path": PIPELINE_FILE}
|
||||
Schema = _Schema(LOCK_FILE_STAGE_SCHEMA)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from dvc_objects.hashfile.hash_info import HashInfo
|
||||
from dvc_objects.hash_info import HashInfo
|
||||
|
||||
|
||||
def test_as_raw():
|
||||
|
||||
Reference in New Issue
Block a user