Skip to content

Commit ddb7c8e

Browse files
committed
deps: bump dvc-objects to >= 4
1 parent c81d7f4 commit ddb7c8e

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ dependencies = [
2525
"dulwich>=0.21.6",
2626
"pygit2>=1.14.0",
2727
"pygtrie>=2.3.2",
28-
"fsspec>=2021.7.0",
28+
"fsspec>=2024.2.0",
2929
"pathspec>=0.9.0",
3030
"asyncssh>=2.13.1,<3",
3131
"funcy>=1.14",
3232
"shortuuid>=0.5.0",
33-
"dvc-objects>=3,<4",
33+
"dvc-objects>=4,<5",
3434
"dvc-http>=2.29.0",
3535
]
3636

@@ -60,7 +60,7 @@ dev = [
6060
]
6161

6262
[tool.setuptools.package-data]
63-
dvc_objects = ["py.typed"]
63+
scmrepo = ["py.typed"]
6464

6565
[tool.setuptools.packages.find]
6666
where = ["src"]

src/scmrepo/git/lfs/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from dvc_http import HTTPFileSystem
88
from dvc_objects.executors import batch_coros
99
from dvc_objects.fs import localfs
10-
from dvc_objects.fs.callbacks import DEFAULT_CALLBACK
1110
from dvc_objects.fs.utils import as_atomic
1211
from fsspec.asyn import sync_wrapper
12+
from fsspec.callbacks import DEFAULT_CALLBACK
1313
from funcy import cached_property
1414

1515
from scmrepo.git.credentials import Credential, CredentialNotFoundError
@@ -18,7 +18,7 @@
1818
from .pointer import Pointer
1919

2020
if TYPE_CHECKING:
21-
from dvc_objects.fs.callbacks import Callback
21+
from fsspec.callbacks import Callback
2222

2323
from .storage import LFSStorage
2424

@@ -142,8 +142,10 @@ async def _download(
142142
):
143143
async def _get_one(from_path: str, to_path: str, **kwargs):
144144
with as_atomic(localfs, to_path, create_parents=True) as tmp_file:
145-
with callback.branch(from_path, tmp_file, kwargs):
146-
await self.httpfs._get_file(from_path, tmp_file, **kwargs) # pylint: disable=protected-access
145+
with callback.branched(from_path, tmp_file) as child:
146+
await self.httpfs._get_file(
147+
from_path, tmp_file, callback=child, **kwargs
148+
) # pylint: disable=protected-access
147149
callback.relative_update()
148150

149151
resp_data = await self._batch_request(objects, **kwargs)

src/scmrepo/git/lfs/progress.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from typing import Any, BinaryIO, Callable, Optional, Union
1+
from typing import BinaryIO, Callable, Optional, Union
22

3-
from dvc_objects.fs.callbacks import DEFAULT_CALLBACK, Callback, TqdmCallback
3+
from dvc_objects.fs.callbacks import TqdmCallback
4+
from fsspec.callbacks import DEFAULT_CALLBACK, Callback
45

56
from scmrepo.progress import GitProgressEvent
67

@@ -33,22 +34,12 @@ def _update_git(self):
3334
)
3435
self.git_progress(event)
3536

36-
def branch(
37-
self,
38-
path_1: Union[str, BinaryIO],
39-
path_2: str,
40-
kwargs: dict[str, Any],
41-
child: Optional[Callback] = None,
42-
):
43-
if child:
44-
pass
45-
elif self.git_progress:
46-
child = TqdmCallback(
37+
def branched(self, path_1: Union[str, BinaryIO], path_2: str, **kwargs):
38+
if self.git_progress:
39+
return TqdmCallback(
4740
bytes=True, desc=path_1 if isinstance(path_1, str) else path_2
4841
)
49-
else:
50-
child = DEFAULT_CALLBACK
51-
return super().branch(path_1, path_2, kwargs, child=child)
42+
return DEFAULT_CALLBACK
5243

5344
@classmethod
5445
def as_lfs_callback(

0 commit comments

Comments
 (0)