dvc-objects 5.1.2__tar.gz → 5.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.cruft.json +2 -2
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.github/workflows/release.yml +3 -3
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.github/workflows/tests.yml +2 -4
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.github/workflows/update-template.yaml +1 -1
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.pre-commit-config.yaml +1 -1
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/CONTRIBUTING.rst +3 -3
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/LICENSE +1 -1
- {dvc_objects-5.1.2/src/dvc_objects.egg-info → dvc_objects-5.3.0}/PKG-INFO +15 -14
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/README.rst +7 -7
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/pyproject.toml +9 -6
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/base.py +47 -10
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/system.py +1 -1
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/utils.py +4 -1
- {dvc_objects-5.1.2 → dvc_objects-5.3.0/src/dvc_objects.egg-info}/PKG-INFO +15 -14
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects.egg-info/SOURCES.txt +2 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects.egg-info/requires.txt +3 -3
- dvc_objects-5.3.0/src/dvc_objects.egg-info/scm_file_list.json +49 -0
- dvc_objects-5.3.0/src/dvc_objects.egg-info/scm_version.json +8 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/test_localfs.py +27 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.gitattributes +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.github/dependabot.yml +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/.gitignore +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/CODE_OF_CONDUCT.rst +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/noxfile.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/setup.cfg +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/__init__.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/compat.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/db.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/errors.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/executors.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/__init__.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/callbacks.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/errors.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/generic.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/local.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/memory.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/fs/scheme.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/obj.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/py.typed +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects/transfer.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects.egg-info/dependency_links.txt +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/src/dvc_objects.egg-info/top_level.txt +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/__init__.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/benchmarks/__init__.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/benchmarks/test_fs.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/conftest.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/__init__.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/test_callbacks.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/test_generic.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/test_system.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/fs/test_utils.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/test_odb.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/test_reflink.py +0 -0
- {dvc_objects-5.1.2 → dvc_objects-5.3.0}/tests/test_transfer.py +0 -0
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"project_name": "dvc-objects",
|
|
8
8
|
"package_name": "dvc_objects",
|
|
9
9
|
"friendly_name": "DVC objects",
|
|
10
|
-
"author": "
|
|
10
|
+
"author": "Treeverse",
|
|
11
11
|
"email": "support@dvc.org",
|
|
12
|
-
"github_user": "
|
|
12
|
+
"github_user": "treeverse",
|
|
13
13
|
"version": "0.0.0",
|
|
14
14
|
"copyright_year": "2022",
|
|
15
15
|
"license": "Apache-2.0",
|
|
@@ -17,14 +17,14 @@ jobs:
|
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
18
|
steps:
|
|
19
19
|
- name: Check out the repository
|
|
20
|
-
uses: actions/checkout@
|
|
20
|
+
uses: actions/checkout@v7
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
|
|
24
|
-
- name: Set up Python 3.
|
|
24
|
+
- name: Set up Python 3.15
|
|
25
25
|
uses: actions/setup-python@v6
|
|
26
26
|
with:
|
|
27
|
-
python-version: '3.
|
|
27
|
+
python-version: '3.15'
|
|
28
28
|
|
|
29
29
|
- name: Upgrade pip and nox
|
|
30
30
|
run: |
|
|
@@ -21,13 +21,11 @@ jobs:
|
|
|
21
21
|
fail-fast: false
|
|
22
22
|
matrix:
|
|
23
23
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
24
|
-
pyv: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
|
25
|
-
include:
|
|
26
|
-
- {os: ubuntu-latest, pyv: 'pypy3.9'}
|
|
24
|
+
pyv: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
|
|
27
25
|
|
|
28
26
|
steps:
|
|
29
27
|
- name: Check out the repository
|
|
30
|
-
uses: actions/checkout@
|
|
28
|
+
uses: actions/checkout@v7
|
|
31
29
|
with:
|
|
32
30
|
fetch-depth: 0
|
|
33
31
|
|
|
@@ -12,8 +12,8 @@ Here is a list of important resources for contributors:
|
|
|
12
12
|
- `Code of Conduct`_
|
|
13
13
|
|
|
14
14
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
15
|
-
.. _Source Code: https://github.com/
|
|
16
|
-
.. _Issue Tracker: https://github.com/
|
|
15
|
+
.. _Source Code: https://github.com/treeverse/dvc-objects
|
|
16
|
+
.. _Issue Tracker: https://github.com/treeverse/dvc-objects/issues
|
|
17
17
|
|
|
18
18
|
How to report a bug
|
|
19
19
|
-------------------
|
|
@@ -104,6 +104,6 @@ To run linting and code formatting checks, you can invoke a `lint` session in no
|
|
|
104
104
|
It is recommended to open an issue before starting work on anything.
|
|
105
105
|
This will allow a chance to talk it over with the owners and validate your approach.
|
|
106
106
|
|
|
107
|
-
.. _pull request: https://github.com/
|
|
107
|
+
.. _pull request: https://github.com/treeverse/dvc-objects/pulls
|
|
108
108
|
.. github-only
|
|
109
109
|
.. _Code of Conduct: CODE_OF_CONDUCT.rst
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2025 Treeverse.
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dvc-objects
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: dvc objects - filesystem and object-db level abstractions to use in dvc and dvc-data
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Treeverse <support@dvc.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Issues, https://github.com/
|
|
8
|
-
Project-URL: Source, https://github.com/
|
|
7
|
+
Project-URL: Issues, https://github.com/treeverse/dvc-objects/issues
|
|
8
|
+
Project-URL: Source, https://github.com/treeverse/dvc-objects
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.9
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
16
17
|
Classifier: Development Status :: 4 - Beta
|
|
17
18
|
Requires-Python: >=3.9
|
|
18
19
|
Description-Content-Type: text/x-rst
|
|
@@ -20,16 +21,16 @@ License-File: LICENSE
|
|
|
20
21
|
Requires-Dist: fsspec>=2024.2.0
|
|
21
22
|
Requires-Dist: funcy>=1.14; python_version < "3.12"
|
|
22
23
|
Provides-Extra: tests
|
|
23
|
-
Requires-Dist: pytest<
|
|
24
|
+
Requires-Dist: pytest<10,>=7; extra == "tests"
|
|
24
25
|
Requires-Dist: pytest-sugar; extra == "tests"
|
|
25
26
|
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
|
|
26
27
|
Requires-Dist: pytest-mock; extra == "tests"
|
|
27
28
|
Requires-Dist: pytest-benchmark; extra == "tests"
|
|
28
|
-
Requires-Dist: pytest-asyncio<2,>=0.
|
|
29
|
+
Requires-Dist: pytest-asyncio<2,>=0.24; extra == "tests"
|
|
29
30
|
Requires-Dist: reflink; extra == "tests"
|
|
30
31
|
Provides-Extra: dev
|
|
31
32
|
Requires-Dist: dvc-objects[tests]; extra == "dev"
|
|
32
|
-
Requires-Dist: mypy==1.
|
|
33
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
33
34
|
Dynamic: license-file
|
|
34
35
|
|
|
35
36
|
DVC objects
|
|
@@ -51,11 +52,11 @@ DVC objects
|
|
|
51
52
|
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
|
|
52
53
|
:target: https://opensource.org/licenses/Apache-2.0
|
|
53
54
|
:alt: License
|
|
54
|
-
.. |Tests| image:: https://github.com/
|
|
55
|
-
:target: https://github.com/
|
|
55
|
+
.. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
|
|
56
|
+
:target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
|
|
56
57
|
:alt: Tests
|
|
57
|
-
.. |Codecov| image:: https://codecov.io/gh/
|
|
58
|
-
:target: https://app.codecov.io/gh/
|
|
58
|
+
.. |Codecov| image:: https://codecov.io/gh/treeverse/dvc-objects/branch/main/graph/badge.svg
|
|
59
|
+
:target: https://app.codecov.io/gh/treeverse/dvc-objects
|
|
59
60
|
:alt: Codecov
|
|
60
61
|
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
|
|
61
62
|
:target: https://github.com/pre-commit/pre-commit
|
|
@@ -123,9 +124,9 @@ please `file an issue`_ along with a detailed description.
|
|
|
123
124
|
|
|
124
125
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
125
126
|
.. _PyPI: https://pypi.org/
|
|
126
|
-
.. _file an issue: https://github.com/
|
|
127
|
+
.. _file an issue: https://github.com/treeverse/dvc-objects/issues
|
|
127
128
|
.. _pip: https://pip.pypa.io/
|
|
128
129
|
.. github-only
|
|
129
130
|
.. _Contributor Guide: CONTRIBUTING.rst
|
|
130
|
-
.. _dvc: https://github.com/
|
|
131
|
-
.. _dvc-data: https://github.com/
|
|
131
|
+
.. _dvc: https://github.com/treeverse/dvc
|
|
132
|
+
.. _dvc-data: https://github.com/treeverse/dvc-data
|
|
@@ -17,11 +17,11 @@ DVC objects
|
|
|
17
17
|
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
|
|
18
18
|
:target: https://opensource.org/licenses/Apache-2.0
|
|
19
19
|
:alt: License
|
|
20
|
-
.. |Tests| image:: https://github.com/
|
|
21
|
-
:target: https://github.com/
|
|
20
|
+
.. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
|
|
21
|
+
:target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
|
|
22
22
|
:alt: Tests
|
|
23
|
-
.. |Codecov| image:: https://codecov.io/gh/
|
|
24
|
-
:target: https://app.codecov.io/gh/
|
|
23
|
+
.. |Codecov| image:: https://codecov.io/gh/treeverse/dvc-objects/branch/main/graph/badge.svg
|
|
24
|
+
:target: https://app.codecov.io/gh/treeverse/dvc-objects
|
|
25
25
|
:alt: Codecov
|
|
26
26
|
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
|
|
27
27
|
:target: https://github.com/pre-commit/pre-commit
|
|
@@ -89,9 +89,9 @@ please `file an issue`_ along with a detailed description.
|
|
|
89
89
|
|
|
90
90
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
91
91
|
.. _PyPI: https://pypi.org/
|
|
92
|
-
.. _file an issue: https://github.com/
|
|
92
|
+
.. _file an issue: https://github.com/treeverse/dvc-objects/issues
|
|
93
93
|
.. _pip: https://pip.pypa.io/
|
|
94
94
|
.. github-only
|
|
95
95
|
.. _Contributor Guide: CONTRIBUTING.rst
|
|
96
|
-
.. _dvc: https://github.com/
|
|
97
|
-
.. _dvc-data: https://github.com/
|
|
96
|
+
.. _dvc: https://github.com/treeverse/dvc
|
|
97
|
+
.. _dvc-data: https://github.com/treeverse/dvc-data
|
|
@@ -9,7 +9,8 @@ name = "dvc-objects"
|
|
|
9
9
|
description = "dvc objects - filesystem and object-db level abstractions to use in dvc and dvc-data"
|
|
10
10
|
readme = "README.rst"
|
|
11
11
|
license = "Apache-2.0"
|
|
12
|
-
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Treeverse", email = "support@dvc.org" }]
|
|
13
14
|
classifiers = [
|
|
14
15
|
"Programming Language :: Python :: 3",
|
|
15
16
|
"Programming Language :: Python :: 3.9",
|
|
@@ -18,6 +19,7 @@ classifiers = [
|
|
|
18
19
|
"Programming Language :: Python :: 3.12",
|
|
19
20
|
"Programming Language :: Python :: 3.13",
|
|
20
21
|
"Programming Language :: Python :: 3.14",
|
|
22
|
+
"Programming Language :: Python :: 3.15",
|
|
21
23
|
"Development Status :: 4 - Beta",
|
|
22
24
|
]
|
|
23
25
|
requires-python = ">=3.9"
|
|
@@ -28,22 +30,22 @@ dependencies = [
|
|
|
28
30
|
]
|
|
29
31
|
|
|
30
32
|
[project.urls]
|
|
31
|
-
Issues = "https://github.com/
|
|
32
|
-
Source = "https://github.com/
|
|
33
|
+
Issues = "https://github.com/treeverse/dvc-objects/issues"
|
|
34
|
+
Source = "https://github.com/treeverse/dvc-objects"
|
|
33
35
|
|
|
34
36
|
[project.optional-dependencies]
|
|
35
37
|
tests = [
|
|
36
|
-
"pytest>=7,<
|
|
38
|
+
"pytest>=7,<10",
|
|
37
39
|
"pytest-sugar",
|
|
38
40
|
"pytest-cov>=4.1.0",
|
|
39
41
|
"pytest-mock",
|
|
40
42
|
"pytest-benchmark",
|
|
41
|
-
"pytest-asyncio>=0.
|
|
43
|
+
"pytest-asyncio>=0.24,<2",
|
|
42
44
|
"reflink",
|
|
43
45
|
]
|
|
44
46
|
dev = [
|
|
45
47
|
"dvc-objects[tests]",
|
|
46
|
-
"mypy==1.
|
|
48
|
+
"mypy==1.19.1",
|
|
47
49
|
]
|
|
48
50
|
|
|
49
51
|
[tool.setuptools.packages.find]
|
|
@@ -55,6 +57,7 @@ dvc_objects = ["py.typed"]
|
|
|
55
57
|
|
|
56
58
|
[tool.pytest.ini_options]
|
|
57
59
|
addopts = "-ra -Werror --benchmark-skip"
|
|
60
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
58
61
|
|
|
59
62
|
[tool.coverage.run]
|
|
60
63
|
branch = true
|
|
@@ -5,7 +5,7 @@ import ntpath
|
|
|
5
5
|
import os
|
|
6
6
|
import posixpath
|
|
7
7
|
import shutil
|
|
8
|
-
from collections.abc import Iterable, Iterator
|
|
8
|
+
from collections.abc import Iterable, Iterator
|
|
9
9
|
from functools import partial
|
|
10
10
|
from multiprocessing import cpu_count
|
|
11
11
|
from typing import (
|
|
@@ -133,10 +133,6 @@ class FileSystem:
|
|
|
133
133
|
path = self.join(self.getcwd(), path)
|
|
134
134
|
return self.normpath(path)
|
|
135
135
|
|
|
136
|
-
@classmethod
|
|
137
|
-
def commonprefix(cls, paths: Sequence[str]) -> str:
|
|
138
|
-
return cls.flavour.commonprefix(paths)
|
|
139
|
-
|
|
140
136
|
@classmethod
|
|
141
137
|
def commonpath(cls, paths: Iterable[str]) -> str:
|
|
142
138
|
return cls.flavour.commonpath(list(paths))
|
|
@@ -573,6 +569,7 @@ class FileSystem:
|
|
|
573
569
|
path: AnyFSPath,
|
|
574
570
|
callback: fsspec.Callback = ...,
|
|
575
571
|
batch_size: Optional[int] = ...,
|
|
572
|
+
return_exceptions: Literal[False] = ...,
|
|
576
573
|
**kwargs,
|
|
577
574
|
) -> "Entry": ...
|
|
578
575
|
|
|
@@ -582,12 +579,44 @@ class FileSystem:
|
|
|
582
579
|
path: list[AnyFSPath],
|
|
583
580
|
callback: fsspec.Callback = ...,
|
|
584
581
|
batch_size: Optional[int] = ...,
|
|
582
|
+
return_exceptions: Literal[False] = ...,
|
|
585
583
|
) -> list["Entry"]: ...
|
|
586
584
|
|
|
587
|
-
|
|
585
|
+
@overload
|
|
586
|
+
def info(
|
|
587
|
+
self,
|
|
588
|
+
path: AnyFSPath,
|
|
589
|
+
callback: fsspec.Callback = ...,
|
|
590
|
+
batch_size: Optional[int] = ...,
|
|
591
|
+
return_exceptions: Literal[True] = ...,
|
|
592
|
+
**kwargs,
|
|
593
|
+
) -> Union["Entry", Exception]: ...
|
|
594
|
+
|
|
595
|
+
@overload
|
|
596
|
+
def info(
|
|
597
|
+
self,
|
|
598
|
+
path: list[AnyFSPath],
|
|
599
|
+
callback: fsspec.Callback = ...,
|
|
600
|
+
batch_size: Optional[int] = ...,
|
|
601
|
+
return_exceptions: Literal[True] = ...,
|
|
602
|
+
) -> list[Union["Entry", Exception]]: ...
|
|
603
|
+
|
|
604
|
+
def info(
|
|
605
|
+
self,
|
|
606
|
+
path,
|
|
607
|
+
callback: fsspec.Callback = DEFAULT_CALLBACK,
|
|
608
|
+
batch_size=None,
|
|
609
|
+
return_exceptions=False,
|
|
610
|
+
**kwargs,
|
|
611
|
+
):
|
|
588
612
|
if isinstance(path, str):
|
|
589
|
-
|
|
590
|
-
|
|
613
|
+
try:
|
|
614
|
+
return self.fs.info(path, **kwargs)
|
|
615
|
+
except Exception as e:
|
|
616
|
+
if return_exceptions:
|
|
617
|
+
return e
|
|
618
|
+
raise
|
|
619
|
+
|
|
591
620
|
jobs = batch_size or self.jobs
|
|
592
621
|
if self.fs.async_impl:
|
|
593
622
|
loop = get_loop()
|
|
@@ -596,14 +625,22 @@ class FileSystem:
|
|
|
596
625
|
[self.fs._info(p, **kwargs) for p in path],
|
|
597
626
|
batch_size=jobs,
|
|
598
627
|
callback=callback,
|
|
628
|
+
return_exceptions=return_exceptions,
|
|
599
629
|
),
|
|
600
630
|
loop,
|
|
601
631
|
)
|
|
602
632
|
return fut.result()
|
|
603
633
|
|
|
604
|
-
|
|
634
|
+
def info_func(p):
|
|
635
|
+
try:
|
|
636
|
+
return self.fs.info(p, **kwargs)
|
|
637
|
+
except Exception as e:
|
|
638
|
+
if return_exceptions:
|
|
639
|
+
return e
|
|
640
|
+
raise
|
|
641
|
+
|
|
605
642
|
with ThreadPoolExecutor(max_workers=jobs, cancel_on_error=True) as executor:
|
|
606
|
-
it = executor.map(
|
|
643
|
+
it = executor.map(info_func, path)
|
|
607
644
|
return list(callback.wrap(it))
|
|
608
645
|
|
|
609
646
|
def mkdir(
|
|
@@ -18,7 +18,7 @@ has_link = hasattr(os, "link")
|
|
|
18
18
|
def hardlink(source: "AnyFSPath", link_name: "AnyFSPath") -> None:
|
|
19
19
|
if not has_link:
|
|
20
20
|
# some Python ports (eg: Termux) don't have os.link()
|
|
21
|
-
# see: https://github.com/
|
|
21
|
+
# see: https://github.com/treeverse/dvc/issues/10875
|
|
22
22
|
raise OSError(errno.ENOTSUP, "hardlink is not supported")
|
|
23
23
|
|
|
24
24
|
# NOTE: we should really be using `os.link()` here with
|
|
@@ -53,7 +53,10 @@ def relpath(path: "AnyFSPath", start: "AnyFSPath" = os.curdir) -> "AnyFSPath":
|
|
|
53
53
|
|
|
54
54
|
path = resolve_network_drive_windows(os.path.abspath(path))
|
|
55
55
|
start = resolve_network_drive_windows(start)
|
|
56
|
-
|
|
56
|
+
try:
|
|
57
|
+
os.path.commonpath([start, path])
|
|
58
|
+
except ValueError:
|
|
59
|
+
# paths are on different drives
|
|
57
60
|
return path
|
|
58
61
|
return os.path.relpath(path, start)
|
|
59
62
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dvc-objects
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.3.0
|
|
4
4
|
Summary: dvc objects - filesystem and object-db level abstractions to use in dvc and dvc-data
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Treeverse <support@dvc.org>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Issues, https://github.com/
|
|
8
|
-
Project-URL: Source, https://github.com/
|
|
7
|
+
Project-URL: Issues, https://github.com/treeverse/dvc-objects/issues
|
|
8
|
+
Project-URL: Source, https://github.com/treeverse/dvc-objects
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.9
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
16
17
|
Classifier: Development Status :: 4 - Beta
|
|
17
18
|
Requires-Python: >=3.9
|
|
18
19
|
Description-Content-Type: text/x-rst
|
|
@@ -20,16 +21,16 @@ License-File: LICENSE
|
|
|
20
21
|
Requires-Dist: fsspec>=2024.2.0
|
|
21
22
|
Requires-Dist: funcy>=1.14; python_version < "3.12"
|
|
22
23
|
Provides-Extra: tests
|
|
23
|
-
Requires-Dist: pytest<
|
|
24
|
+
Requires-Dist: pytest<10,>=7; extra == "tests"
|
|
24
25
|
Requires-Dist: pytest-sugar; extra == "tests"
|
|
25
26
|
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
|
|
26
27
|
Requires-Dist: pytest-mock; extra == "tests"
|
|
27
28
|
Requires-Dist: pytest-benchmark; extra == "tests"
|
|
28
|
-
Requires-Dist: pytest-asyncio<2,>=0.
|
|
29
|
+
Requires-Dist: pytest-asyncio<2,>=0.24; extra == "tests"
|
|
29
30
|
Requires-Dist: reflink; extra == "tests"
|
|
30
31
|
Provides-Extra: dev
|
|
31
32
|
Requires-Dist: dvc-objects[tests]; extra == "dev"
|
|
32
|
-
Requires-Dist: mypy==1.
|
|
33
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
33
34
|
Dynamic: license-file
|
|
34
35
|
|
|
35
36
|
DVC objects
|
|
@@ -51,11 +52,11 @@ DVC objects
|
|
|
51
52
|
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
|
|
52
53
|
:target: https://opensource.org/licenses/Apache-2.0
|
|
53
54
|
:alt: License
|
|
54
|
-
.. |Tests| image:: https://github.com/
|
|
55
|
-
:target: https://github.com/
|
|
55
|
+
.. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
|
|
56
|
+
:target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
|
|
56
57
|
:alt: Tests
|
|
57
|
-
.. |Codecov| image:: https://codecov.io/gh/
|
|
58
|
-
:target: https://app.codecov.io/gh/
|
|
58
|
+
.. |Codecov| image:: https://codecov.io/gh/treeverse/dvc-objects/branch/main/graph/badge.svg
|
|
59
|
+
:target: https://app.codecov.io/gh/treeverse/dvc-objects
|
|
59
60
|
:alt: Codecov
|
|
60
61
|
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
|
|
61
62
|
:target: https://github.com/pre-commit/pre-commit
|
|
@@ -123,9 +124,9 @@ please `file an issue`_ along with a detailed description.
|
|
|
123
124
|
|
|
124
125
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
125
126
|
.. _PyPI: https://pypi.org/
|
|
126
|
-
.. _file an issue: https://github.com/
|
|
127
|
+
.. _file an issue: https://github.com/treeverse/dvc-objects/issues
|
|
127
128
|
.. _pip: https://pip.pypa.io/
|
|
128
129
|
.. github-only
|
|
129
130
|
.. _Contributor Guide: CONTRIBUTING.rst
|
|
130
|
-
.. _dvc: https://github.com/
|
|
131
|
-
.. _dvc-data: https://github.com/
|
|
131
|
+
.. _dvc: https://github.com/treeverse/dvc
|
|
132
|
+
.. _dvc-data: https://github.com/treeverse/dvc-data
|
|
@@ -24,6 +24,8 @@ src/dvc_objects.egg-info/PKG-INFO
|
|
|
24
24
|
src/dvc_objects.egg-info/SOURCES.txt
|
|
25
25
|
src/dvc_objects.egg-info/dependency_links.txt
|
|
26
26
|
src/dvc_objects.egg-info/requires.txt
|
|
27
|
+
src/dvc_objects.egg-info/scm_file_list.json
|
|
28
|
+
src/dvc_objects.egg-info/scm_version.json
|
|
27
29
|
src/dvc_objects.egg-info/top_level.txt
|
|
28
30
|
src/dvc_objects/fs/__init__.py
|
|
29
31
|
src/dvc_objects/fs/base.py
|
|
@@ -5,13 +5,13 @@ funcy>=1.14
|
|
|
5
5
|
|
|
6
6
|
[dev]
|
|
7
7
|
dvc-objects[tests]
|
|
8
|
-
mypy==1.
|
|
8
|
+
mypy==1.19.1
|
|
9
9
|
|
|
10
10
|
[tests]
|
|
11
|
-
pytest<
|
|
11
|
+
pytest<10,>=7
|
|
12
12
|
pytest-sugar
|
|
13
13
|
pytest-cov>=4.1.0
|
|
14
14
|
pytest-mock
|
|
15
15
|
pytest-benchmark
|
|
16
|
-
pytest-asyncio<2,>=0.
|
|
16
|
+
pytest-asyncio<2,>=0.24
|
|
17
17
|
reflink
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
".cruft.json",
|
|
4
|
+
".gitattributes",
|
|
5
|
+
".github/dependabot.yml",
|
|
6
|
+
".github/workflows/release.yml",
|
|
7
|
+
".github/workflows/tests.yml",
|
|
8
|
+
".github/workflows/update-template.yaml",
|
|
9
|
+
".gitignore",
|
|
10
|
+
".pre-commit-config.yaml",
|
|
11
|
+
"CODE_OF_CONDUCT.rst",
|
|
12
|
+
"CONTRIBUTING.rst",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.rst",
|
|
15
|
+
"noxfile.py",
|
|
16
|
+
"pyproject.toml",
|
|
17
|
+
"src/dvc_objects/__init__.py",
|
|
18
|
+
"src/dvc_objects/compat.py",
|
|
19
|
+
"src/dvc_objects/db.py",
|
|
20
|
+
"src/dvc_objects/errors.py",
|
|
21
|
+
"src/dvc_objects/executors.py",
|
|
22
|
+
"src/dvc_objects/fs/__init__.py",
|
|
23
|
+
"src/dvc_objects/fs/base.py",
|
|
24
|
+
"src/dvc_objects/fs/callbacks.py",
|
|
25
|
+
"src/dvc_objects/fs/errors.py",
|
|
26
|
+
"src/dvc_objects/fs/generic.py",
|
|
27
|
+
"src/dvc_objects/fs/local.py",
|
|
28
|
+
"src/dvc_objects/fs/memory.py",
|
|
29
|
+
"src/dvc_objects/fs/scheme.py",
|
|
30
|
+
"src/dvc_objects/fs/system.py",
|
|
31
|
+
"src/dvc_objects/fs/utils.py",
|
|
32
|
+
"src/dvc_objects/obj.py",
|
|
33
|
+
"src/dvc_objects/py.typed",
|
|
34
|
+
"src/dvc_objects/transfer.py",
|
|
35
|
+
"tests/__init__.py",
|
|
36
|
+
"tests/benchmarks/__init__.py",
|
|
37
|
+
"tests/benchmarks/test_fs.py",
|
|
38
|
+
"tests/conftest.py",
|
|
39
|
+
"tests/fs/__init__.py",
|
|
40
|
+
"tests/fs/test_callbacks.py",
|
|
41
|
+
"tests/fs/test_generic.py",
|
|
42
|
+
"tests/fs/test_localfs.py",
|
|
43
|
+
"tests/fs/test_system.py",
|
|
44
|
+
"tests/fs/test_utils.py",
|
|
45
|
+
"tests/test_odb.py",
|
|
46
|
+
"tests/test_reflink.py",
|
|
47
|
+
"tests/test_transfer.py"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -133,3 +133,30 @@ def test_normpath_with_newlines():
|
|
|
133
133
|
fs = LocalFileSystem()
|
|
134
134
|
newline_path = os.path.join("one", "two\nthree")
|
|
135
135
|
assert fs.normpath(newline_path) == newline_path
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_info_return_exceptions(tmp_path):
|
|
139
|
+
fs = LocalFileSystem()
|
|
140
|
+
path = fspath(tmp_path / "non-existent")
|
|
141
|
+
|
|
142
|
+
with pytest.raises(FileNotFoundError):
|
|
143
|
+
fs.info(path)
|
|
144
|
+
|
|
145
|
+
result = fs.info(path, return_exceptions=True)
|
|
146
|
+
assert isinstance(result, FileNotFoundError)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def test_info_return_exceptions_batch(tmp_path):
|
|
150
|
+
fs = LocalFileSystem()
|
|
151
|
+
exist_path = fspath(tmp_path / "existent")
|
|
152
|
+
non_exist_path = fspath(tmp_path / "non-existent")
|
|
153
|
+
(tmp_path / "existent").write_text("foo")
|
|
154
|
+
|
|
155
|
+
# default behavior: raises on first error
|
|
156
|
+
with pytest.raises(FileNotFoundError):
|
|
157
|
+
fs.info([exist_path, non_exist_path])
|
|
158
|
+
|
|
159
|
+
results = fs.info([exist_path, non_exist_path], return_exceptions=True)
|
|
160
|
+
assert isinstance(results[0], dict)
|
|
161
|
+
assert fs.normpath(results[0]["name"]) == exist_path
|
|
162
|
+
assert isinstance(results[1], FileNotFoundError)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|