Skip to content

Commit 76228a2

Browse files
authored
dvc: split remotes from trees (#4212)
* dvc: remove tree-specific wrappers from remote This helps combat the remote/tree/cache confusion. * dvc: split remotes from trees Related to #4050
1 parent bbb1c59 commit 76228a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1292
-1229
lines changed

dvc/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_url(path, repo=None, rev=None, remote=None):
3030
raise UrlNotDvcRepoError(_repo.url) # pylint: disable=no-member
3131
out = _repo.find_out_by_relpath(path)
3232
remote_obj = _repo.cloud.get_remote(remote)
33-
return str(remote_obj.hash_to_path_info(out.checksum))
33+
return str(remote_obj.tree.hash_to_path_info(out.checksum))
3434

3535

3636
def open( # noqa, pylint: disable=redefined-builtin

dvc/command/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_linktype_support_info(repo):
122122

123123
@staticmethod
124124
def get_supported_remotes():
125-
from dvc.remote import TREES
125+
from dvc.tree import TREES
126126

127127
supported_remotes = []
128128
for tree_cls in TREES:

dvc/dependency/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
from dvc.dependency.s3 import S3Dependency
1313
from dvc.dependency.ssh import SSHDependency
1414
from dvc.output.base import BaseOutput
15-
from dvc.remote import get_cloud_tree
1615
from dvc.scheme import Schemes
1716

17+
from ..tree import get_cloud_tree
1818
from .repo import RepoDependency
1919

2020
DEPS = [

dvc/dependency/azure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dvc.dependency.base import BaseDependency
22
from dvc.output.base import BaseOutput
3-
from dvc.remote.azure import AzureRemoteTree
3+
4+
from ..tree.azure import AzureRemoteTree
45

56

67
class AzureDependency(BaseDependency, BaseOutput):

dvc/dependency/http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dvc.dependency.base import BaseDependency
22
from dvc.output.base import BaseOutput
3-
from dvc.remote.http import HTTPRemoteTree
3+
4+
from ..tree.http import HTTPRemoteTree
45

56

67
class HTTPDependency(BaseDependency, BaseOutput):

dvc/dependency/https.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from dvc.remote.https import HTTPSRemoteTree
2-
1+
from ..tree.https import HTTPSRemoteTree
32
from .http import HTTPDependency
43

54

dvc/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from dvc.exceptions import DvcException, DvcParserError, NotDvcRepoError
1010
from dvc.external_repo import clean_repos
1111
from dvc.logger import FOOTER, disable_other_loggers
12-
from dvc.remote.pool import close_pools
12+
from dvc.tree.pool import close_pools
1313
from dvc.utils import format_link
1414

1515
# Workaround for CPython bug. See [1] and [2] for more info.

dvc/output/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
from dvc.output.local import LocalOutput
1111
from dvc.output.s3 import S3Output
1212
from dvc.output.ssh import SSHOutput
13-
from dvc.remote import get_cloud_tree
14-
from dvc.remote.hdfs import HDFSRemoteTree
15-
from dvc.remote.local import LocalRemoteTree
16-
from dvc.remote.s3 import S3RemoteTree
1713
from dvc.scheme import Schemes
1814

15+
from ..tree import get_cloud_tree
16+
from ..tree.hdfs import HDFSRemoteTree
17+
from ..tree.local import LocalRemoteTree
18+
from ..tree.s3 import S3RemoteTree
19+
1920
OUTS = [
2021
HDFSOutput,
2122
S3Output,

dvc/output/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
DvcException,
1313
RemoteCacheRequiredError,
1414
)
15-
from dvc.remote.base import BaseRemoteTree
15+
16+
from ..tree.base import BaseRemoteTree
1617

1718
logger = logging.getLogger(__name__)
1819

dvc/output/gs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from dvc.output.s3 import S3Output
2-
from dvc.remote.gs import GSRemoteTree
2+
3+
from ..tree.gs import GSRemoteTree
34

45

56
class GSOutput(S3Output):

0 commit comments

Comments
 (0)