forked from iterative/dvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
odb: treat external repo dependencies as objects (iterative#6109)
* objects: add ExternalRepoFile object type * RepoDependency: implement get_obj (use ExternalRepoFile) * drop distinction between used external and used objects * update tests * remove unneeded fetch from ExternalRepoFile * wrap erepo errors as an object error * update cloud/remote functions for new used_objs behavior * fix update() rev/locked behavior * update import tests * remove ExternalRepoFile * move get_obj and get_used_objs implementations back into repo dependency * return objects plus associated ODB (remote) in get_used_objs * odb: add tmp_dir field and support creating Remote from an odb * return dict mapping odb -> objects in get_used_objs * use dummy git odb for git imports * fetch: support pulling from specific odb * update cloud funcs for get_used_objs usage * update tests for used_objs behavior * use fetch in dep.download * catch circular imports from local fs repos * add tests for chained and circular imports * move tmp_dir into odb config * update return docstring for repo.used_objs
- Loading branch information
Showing
19 changed files
with
411 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import logging | ||
|
||
from .base import ObjectDB | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class GitObjectDB(ObjectDB): | ||
"""Dummy read-only ODB for uncached objects in external Git repos.""" | ||
|
||
def __init__(self, fs, path_info, **config): | ||
from dvc.fs.repo import RepoFileSystem | ||
|
||
assert isinstance(fs, RepoFileSystem) | ||
super().__init__(fs, path_info) | ||
|
||
def get(self, hash_info): | ||
raise NotImplementedError | ||
|
||
def add(self, path_info, fs, hash_info, move=True, **kwargs): | ||
raise NotImplementedError | ||
|
||
def gc(self, used, jobs=None): | ||
raise NotImplementedError |
Oops, something went wrong.