mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fetch: show progress when collecting
This commit is contained in:
+10
-3
@@ -33,6 +33,7 @@ def fetch( # noqa: C901, PLR0913
|
|||||||
config.NoRemoteError: thrown when downloading only local files and no
|
config.NoRemoteError: thrown when downloading only local files and no
|
||||||
remote is configured
|
remote is configured
|
||||||
"""
|
"""
|
||||||
|
from dvc.fs.callbacks import Callback
|
||||||
from dvc_data.index.fetch import fetch as ifetch
|
from dvc_data.index.fetch import fetch as ifetch
|
||||||
|
|
||||||
if isinstance(targets, str):
|
if isinstance(targets, str):
|
||||||
@@ -65,9 +66,15 @@ def fetch( # noqa: C901, PLR0913
|
|||||||
if remote:
|
if remote:
|
||||||
self.config["core"]["remote"] = remote
|
self.config["core"]["remote"] = remote
|
||||||
|
|
||||||
fetch_transferred, fetch_failed = ifetch(
|
with Callback.as_tqdm_callback(
|
||||||
_indexes(), jobs=jobs
|
desc="Fetching",
|
||||||
) # pylint: disable=assignment-from-no-return
|
unit="file",
|
||||||
|
) as cb:
|
||||||
|
fetch_transferred, fetch_failed = ifetch(
|
||||||
|
_indexes(),
|
||||||
|
jobs=jobs,
|
||||||
|
callback=cb,
|
||||||
|
) # pylint: disable=assignment-from-no-return
|
||||||
finally:
|
finally:
|
||||||
if remote:
|
if remote:
|
||||||
self.config["core"]["remote"] = saved_remote
|
self.config["core"]["remote"] = saved_remote
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ dependencies = [
|
|||||||
"configobj>=5.0.6",
|
"configobj>=5.0.6",
|
||||||
"distro>=1.3",
|
"distro>=1.3",
|
||||||
"dpath<3,>=2.1.0",
|
"dpath<3,>=2.1.0",
|
||||||
"dvc-data>=1.2.0,<1.3.0",
|
"dvc-data>=1.2.1,<1.3.0",
|
||||||
"dvc-http>=2.29.0",
|
"dvc-http>=2.29.0",
|
||||||
"dvc-render>=0.3.1,<1",
|
"dvc-render>=0.3.1,<1",
|
||||||
"dvc-studio-client>=0.9.2,<1",
|
"dvc-studio-client>=0.9.2,<1",
|
||||||
|
|||||||
Reference in New Issue
Block a user