dvc-objects 5.1.1__tar.gz → 5.2.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.1 → dvc_objects-5.2.0}/.cruft.json +2 -2
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.github/workflows/release.yml +4 -4
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.github/workflows/tests.yml +13 -6
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.github/workflows/update-template.yaml +1 -1
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.pre-commit-config.yaml +3 -3
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/CONTRIBUTING.rst +3 -3
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/LICENSE +1 -1
- {dvc_objects-5.1.1/src/dvc_objects.egg-info → dvc_objects-5.2.0}/PKG-INFO +15 -14
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/README.rst +7 -7
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/noxfile.py +5 -3
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/pyproject.toml +10 -7
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/base.py +46 -5
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/system.py +8 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0/src/dvc_objects.egg-info}/PKG-INFO +15 -14
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/requires.txt +2 -2
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/test_localfs.py +27 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.gitattributes +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.github/dependabot.yml +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/.gitignore +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/CODE_OF_CONDUCT.rst +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/setup.cfg +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/__init__.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/compat.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/db.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/errors.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/executors.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/__init__.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/callbacks.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/errors.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/generic.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/local.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/memory.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/scheme.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/fs/utils.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/obj.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/py.typed +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects/transfer.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/SOURCES.txt +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/dependency_links.txt +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/top_level.txt +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/__init__.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/benchmarks/__init__.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/benchmarks/test_fs.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/conftest.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/__init__.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/test_callbacks.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/test_generic.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/test_system.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/fs/test_utils.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/test_odb.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.0}/tests/test_reflink.py +0 -0
- {dvc_objects-5.1.1 → dvc_objects-5.2.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@v6
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
|
|
24
|
-
- name: Set up Python 3.
|
|
25
|
-
uses: actions/setup-python@
|
|
24
|
+
- name: Set up Python 3.14
|
|
25
|
+
uses: actions/setup-python@v6
|
|
26
26
|
with:
|
|
27
|
-
python-version: '3.
|
|
27
|
+
python-version: '3.14'
|
|
28
28
|
|
|
29
29
|
- name: Upgrade pip and nox
|
|
30
30
|
run: |
|
|
@@ -21,18 +21,16 @@ 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']
|
|
25
|
-
include:
|
|
26
|
-
- {os: ubuntu-latest, pyv: 'pypy3.9'}
|
|
24
|
+
pyv: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
|
27
25
|
|
|
28
26
|
steps:
|
|
29
27
|
- name: Check out the repository
|
|
30
|
-
uses: actions/checkout@
|
|
28
|
+
uses: actions/checkout@v6
|
|
31
29
|
with:
|
|
32
30
|
fetch-depth: 0
|
|
33
31
|
|
|
34
32
|
- name: Set up Python ${{ matrix.pyv }}
|
|
35
|
-
uses: actions/setup-python@
|
|
33
|
+
uses: actions/setup-python@v6
|
|
36
34
|
with:
|
|
37
35
|
python-version: ${{ matrix.pyv }}
|
|
38
36
|
cache: pip
|
|
@@ -49,7 +47,7 @@ jobs:
|
|
|
49
47
|
run: nox -s lint
|
|
50
48
|
|
|
51
49
|
- name: Run tests
|
|
52
|
-
run: nox -s tests-${{ matrix.
|
|
50
|
+
run: nox -s tests-${{ matrix.pyv }} -- --cov-report=xml
|
|
53
51
|
|
|
54
52
|
- name: Upload coverage report
|
|
55
53
|
uses: codecov/codecov-action@v5
|
|
@@ -59,3 +57,12 @@ jobs:
|
|
|
59
57
|
|
|
60
58
|
- name: Build package
|
|
61
59
|
run: nox -s build
|
|
60
|
+
|
|
61
|
+
check:
|
|
62
|
+
if: always()
|
|
63
|
+
needs: [tests]
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: re-actors/alls-green@release/v1
|
|
67
|
+
with:
|
|
68
|
+
jobs: ${{ toJSON(needs) }}
|
|
@@ -2,7 +2,7 @@ default_language_version:
|
|
|
2
2
|
python: python3
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v6.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: check-added-large-files
|
|
8
8
|
- id: check-case-conflict
|
|
@@ -20,9 +20,9 @@ repos:
|
|
|
20
20
|
- id: sort-simple-yaml
|
|
21
21
|
- id: trailing-whitespace
|
|
22
22
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
23
|
-
rev: 'v0.
|
|
23
|
+
rev: 'v0.14.9'
|
|
24
24
|
hooks:
|
|
25
|
-
- id: ruff
|
|
25
|
+
- id: ruff-check
|
|
26
26
|
args: [--fix, --exit-non-zero-on-fix]
|
|
27
27
|
- id: ruff-format
|
|
28
28
|
- repo: https://github.com/codespell-project/codespell
|
|
@@ -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,17 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dvc-objects
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.2.0
|
|
4
4
|
Summary: dvc objects - filesystem and object-db level abstractions to use in dvc and dvc-data
|
|
5
|
-
Author-email:
|
|
6
|
-
License: Apache-2.0
|
|
7
|
-
Project-URL: Issues, https://github.com/
|
|
8
|
-
Project-URL: Source, https://github.com/
|
|
5
|
+
Author-email: Treeverse <support@dvc.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
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
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
16
|
Classifier: Development Status :: 4 - Beta
|
|
16
17
|
Requires-Python: >=3.9
|
|
17
18
|
Description-Content-Type: text/x-rst
|
|
@@ -24,11 +25,11 @@ Requires-Dist: pytest-sugar; extra == "tests"
|
|
|
24
25
|
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
|
|
25
26
|
Requires-Dist: pytest-mock; extra == "tests"
|
|
26
27
|
Requires-Dist: pytest-benchmark; extra == "tests"
|
|
27
|
-
Requires-Dist: pytest-asyncio<
|
|
28
|
+
Requires-Dist: pytest-asyncio<2,>=0.23.2; extra == "tests"
|
|
28
29
|
Requires-Dist: reflink; extra == "tests"
|
|
29
30
|
Provides-Extra: dev
|
|
30
31
|
Requires-Dist: dvc-objects[tests]; extra == "dev"
|
|
31
|
-
Requires-Dist: mypy==1.
|
|
32
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
32
33
|
Dynamic: license-file
|
|
33
34
|
|
|
34
35
|
DVC objects
|
|
@@ -50,11 +51,11 @@ DVC objects
|
|
|
50
51
|
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
|
|
51
52
|
:target: https://opensource.org/licenses/Apache-2.0
|
|
52
53
|
:alt: License
|
|
53
|
-
.. |Tests| image:: https://github.com/
|
|
54
|
-
:target: https://github.com/
|
|
54
|
+
.. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
|
|
55
|
+
:target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
|
|
55
56
|
:alt: Tests
|
|
56
|
-
.. |Codecov| image:: https://codecov.io/gh/
|
|
57
|
-
:target: https://app.codecov.io/gh/
|
|
57
|
+
.. |Codecov| image:: https://codecov.io/gh/treeverse/dvc-objects/branch/main/graph/badge.svg
|
|
58
|
+
:target: https://app.codecov.io/gh/treeverse/dvc-objects
|
|
58
59
|
:alt: Codecov
|
|
59
60
|
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
|
|
60
61
|
:target: https://github.com/pre-commit/pre-commit
|
|
@@ -122,9 +123,9 @@ please `file an issue`_ along with a detailed description.
|
|
|
122
123
|
|
|
123
124
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
124
125
|
.. _PyPI: https://pypi.org/
|
|
125
|
-
.. _file an issue: https://github.com/
|
|
126
|
+
.. _file an issue: https://github.com/treeverse/dvc-objects/issues
|
|
126
127
|
.. _pip: https://pip.pypa.io/
|
|
127
128
|
.. github-only
|
|
128
129
|
.. _Contributor Guide: CONTRIBUTING.rst
|
|
129
|
-
.. _dvc: https://github.com/
|
|
130
|
-
.. _dvc-data: https://github.com/
|
|
130
|
+
.. _dvc: https://github.com/treeverse/dvc
|
|
131
|
+
.. _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
|
|
@@ -11,10 +11,12 @@ locations = "src", "tests"
|
|
|
11
11
|
|
|
12
12
|
pip_dev_flags = ["--use-pep517"] # reflink package is still missing wheels
|
|
13
13
|
|
|
14
|
+
project = nox.project.load_toml()
|
|
15
|
+
python_versions = nox.project.python_versions(project)
|
|
16
|
+
pypy_versions = ["pypy3.9", "pypy3.10", "pypy3.11"]
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
+
|
|
19
|
+
@nox.session(python=python_versions + pypy_versions)
|
|
18
20
|
def tests(session: nox.Session) -> None:
|
|
19
21
|
session.install(".[tests]", *pip_dev_flags)
|
|
20
22
|
session.run(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77", "setuptools_scm[toml]>=8"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[tool.setuptools_scm]
|
|
@@ -8,8 +8,9 @@ build-backend = "setuptools.build_meta"
|
|
|
8
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
|
-
license =
|
|
12
|
-
|
|
11
|
+
license = "Apache-2.0"
|
|
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",
|
|
@@ -17,6 +18,7 @@ classifiers = [
|
|
|
17
18
|
"Programming Language :: Python :: 3.11",
|
|
18
19
|
"Programming Language :: Python :: 3.12",
|
|
19
20
|
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
20
22
|
"Development Status :: 4 - Beta",
|
|
21
23
|
]
|
|
22
24
|
requires-python = ">=3.9"
|
|
@@ -27,8 +29,8 @@ dependencies = [
|
|
|
27
29
|
]
|
|
28
30
|
|
|
29
31
|
[project.urls]
|
|
30
|
-
Issues = "https://github.com/
|
|
31
|
-
Source = "https://github.com/
|
|
32
|
+
Issues = "https://github.com/treeverse/dvc-objects/issues"
|
|
33
|
+
Source = "https://github.com/treeverse/dvc-objects"
|
|
32
34
|
|
|
33
35
|
[project.optional-dependencies]
|
|
34
36
|
tests = [
|
|
@@ -37,12 +39,12 @@ tests = [
|
|
|
37
39
|
"pytest-cov>=4.1.0",
|
|
38
40
|
"pytest-mock",
|
|
39
41
|
"pytest-benchmark",
|
|
40
|
-
"pytest-asyncio>=0.23.2,<
|
|
42
|
+
"pytest-asyncio>=0.23.2,<2",
|
|
41
43
|
"reflink",
|
|
42
44
|
]
|
|
43
45
|
dev = [
|
|
44
46
|
"dvc-objects[tests]",
|
|
45
|
-
"mypy==1.
|
|
47
|
+
"mypy==1.19.1",
|
|
46
48
|
]
|
|
47
49
|
|
|
48
50
|
[tool.setuptools.packages.find]
|
|
@@ -111,6 +113,7 @@ show-fixes = true
|
|
|
111
113
|
[tool.ruff.lint]
|
|
112
114
|
ignore = [
|
|
113
115
|
"ISC001", # single-line-implicit-string-concatenation
|
|
116
|
+
"PLC0415", # import-outside-top-level
|
|
114
117
|
"PLR2004", # magic-value-comparison
|
|
115
118
|
"PLW2901", # redefined-loop-name
|
|
116
119
|
"RET501", # unnecessary-return-none
|
|
@@ -573,6 +573,7 @@ class FileSystem:
|
|
|
573
573
|
path: AnyFSPath,
|
|
574
574
|
callback: fsspec.Callback = ...,
|
|
575
575
|
batch_size: Optional[int] = ...,
|
|
576
|
+
return_exceptions: Literal[False] = ...,
|
|
576
577
|
**kwargs,
|
|
577
578
|
) -> "Entry": ...
|
|
578
579
|
|
|
@@ -582,12 +583,44 @@ class FileSystem:
|
|
|
582
583
|
path: list[AnyFSPath],
|
|
583
584
|
callback: fsspec.Callback = ...,
|
|
584
585
|
batch_size: Optional[int] = ...,
|
|
586
|
+
return_exceptions: Literal[False] = ...,
|
|
585
587
|
) -> list["Entry"]: ...
|
|
586
588
|
|
|
587
|
-
|
|
589
|
+
@overload
|
|
590
|
+
def info(
|
|
591
|
+
self,
|
|
592
|
+
path: AnyFSPath,
|
|
593
|
+
callback: fsspec.Callback = ...,
|
|
594
|
+
batch_size: Optional[int] = ...,
|
|
595
|
+
return_exceptions: Literal[True] = ...,
|
|
596
|
+
**kwargs,
|
|
597
|
+
) -> Union["Entry", Exception]: ...
|
|
598
|
+
|
|
599
|
+
@overload
|
|
600
|
+
def info(
|
|
601
|
+
self,
|
|
602
|
+
path: list[AnyFSPath],
|
|
603
|
+
callback: fsspec.Callback = ...,
|
|
604
|
+
batch_size: Optional[int] = ...,
|
|
605
|
+
return_exceptions: Literal[True] = ...,
|
|
606
|
+
) -> list[Union["Entry", Exception]]: ...
|
|
607
|
+
|
|
608
|
+
def info(
|
|
609
|
+
self,
|
|
610
|
+
path,
|
|
611
|
+
callback: fsspec.Callback = DEFAULT_CALLBACK,
|
|
612
|
+
batch_size=None,
|
|
613
|
+
return_exceptions=False,
|
|
614
|
+
**kwargs,
|
|
615
|
+
):
|
|
588
616
|
if isinstance(path, str):
|
|
589
|
-
|
|
590
|
-
|
|
617
|
+
try:
|
|
618
|
+
return self.fs.info(path, **kwargs)
|
|
619
|
+
except Exception as e:
|
|
620
|
+
if return_exceptions:
|
|
621
|
+
return e
|
|
622
|
+
raise
|
|
623
|
+
|
|
591
624
|
jobs = batch_size or self.jobs
|
|
592
625
|
if self.fs.async_impl:
|
|
593
626
|
loop = get_loop()
|
|
@@ -596,14 +629,22 @@ class FileSystem:
|
|
|
596
629
|
[self.fs._info(p, **kwargs) for p in path],
|
|
597
630
|
batch_size=jobs,
|
|
598
631
|
callback=callback,
|
|
632
|
+
return_exceptions=return_exceptions,
|
|
599
633
|
),
|
|
600
634
|
loop,
|
|
601
635
|
)
|
|
602
636
|
return fut.result()
|
|
603
637
|
|
|
604
|
-
|
|
638
|
+
def info_func(p):
|
|
639
|
+
try:
|
|
640
|
+
return self.fs.info(p, **kwargs)
|
|
641
|
+
except Exception as e:
|
|
642
|
+
if return_exceptions:
|
|
643
|
+
return e
|
|
644
|
+
raise
|
|
645
|
+
|
|
605
646
|
with ThreadPoolExecutor(max_workers=jobs, cancel_on_error=True) as executor:
|
|
606
|
-
it = executor.map(
|
|
647
|
+
it = executor.map(info_func, path)
|
|
607
648
|
return list(callback.wrap(it))
|
|
608
649
|
|
|
609
650
|
def mkdir(
|
|
@@ -12,7 +12,15 @@ if TYPE_CHECKING:
|
|
|
12
12
|
logger = logging.getLogger(__name__)
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
has_link = hasattr(os, "link")
|
|
16
|
+
|
|
17
|
+
|
|
15
18
|
def hardlink(source: "AnyFSPath", link_name: "AnyFSPath") -> None:
|
|
19
|
+
if not has_link:
|
|
20
|
+
# some Python ports (eg: Termux) don't have os.link()
|
|
21
|
+
# see: https://github.com/treeverse/dvc/issues/10875
|
|
22
|
+
raise OSError(errno.ENOTSUP, "hardlink is not supported")
|
|
23
|
+
|
|
16
24
|
# NOTE: we should really be using `os.link()` here with
|
|
17
25
|
# `follow_symlinks=True`, but unfortunately the implementation is
|
|
18
26
|
# buggy across platforms, so until it is fixed, we just dereference
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dvc-objects
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.2.0
|
|
4
4
|
Summary: dvc objects - filesystem and object-db level abstractions to use in dvc and dvc-data
|
|
5
|
-
Author-email:
|
|
6
|
-
License: Apache-2.0
|
|
7
|
-
Project-URL: Issues, https://github.com/
|
|
8
|
-
Project-URL: Source, https://github.com/
|
|
5
|
+
Author-email: Treeverse <support@dvc.org>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
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
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
16
|
Classifier: Development Status :: 4 - Beta
|
|
16
17
|
Requires-Python: >=3.9
|
|
17
18
|
Description-Content-Type: text/x-rst
|
|
@@ -24,11 +25,11 @@ Requires-Dist: pytest-sugar; extra == "tests"
|
|
|
24
25
|
Requires-Dist: pytest-cov>=4.1.0; extra == "tests"
|
|
25
26
|
Requires-Dist: pytest-mock; extra == "tests"
|
|
26
27
|
Requires-Dist: pytest-benchmark; extra == "tests"
|
|
27
|
-
Requires-Dist: pytest-asyncio<
|
|
28
|
+
Requires-Dist: pytest-asyncio<2,>=0.23.2; extra == "tests"
|
|
28
29
|
Requires-Dist: reflink; extra == "tests"
|
|
29
30
|
Provides-Extra: dev
|
|
30
31
|
Requires-Dist: dvc-objects[tests]; extra == "dev"
|
|
31
|
-
Requires-Dist: mypy==1.
|
|
32
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
32
33
|
Dynamic: license-file
|
|
33
34
|
|
|
34
35
|
DVC objects
|
|
@@ -50,11 +51,11 @@ DVC objects
|
|
|
50
51
|
.. |License| image:: https://img.shields.io/pypi/l/dvc-objects
|
|
51
52
|
:target: https://opensource.org/licenses/Apache-2.0
|
|
52
53
|
:alt: License
|
|
53
|
-
.. |Tests| image:: https://github.com/
|
|
54
|
-
:target: https://github.com/
|
|
54
|
+
.. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
|
|
55
|
+
:target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
|
|
55
56
|
:alt: Tests
|
|
56
|
-
.. |Codecov| image:: https://codecov.io/gh/
|
|
57
|
-
:target: https://app.codecov.io/gh/
|
|
57
|
+
.. |Codecov| image:: https://codecov.io/gh/treeverse/dvc-objects/branch/main/graph/badge.svg
|
|
58
|
+
:target: https://app.codecov.io/gh/treeverse/dvc-objects
|
|
58
59
|
:alt: Codecov
|
|
59
60
|
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
|
|
60
61
|
:target: https://github.com/pre-commit/pre-commit
|
|
@@ -122,9 +123,9 @@ please `file an issue`_ along with a detailed description.
|
|
|
122
123
|
|
|
123
124
|
.. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
|
|
124
125
|
.. _PyPI: https://pypi.org/
|
|
125
|
-
.. _file an issue: https://github.com/
|
|
126
|
+
.. _file an issue: https://github.com/treeverse/dvc-objects/issues
|
|
126
127
|
.. _pip: https://pip.pypa.io/
|
|
127
128
|
.. github-only
|
|
128
129
|
.. _Contributor Guide: CONTRIBUTING.rst
|
|
129
|
-
.. _dvc: https://github.com/
|
|
130
|
-
.. _dvc-data: https://github.com/
|
|
130
|
+
.. _dvc: https://github.com/treeverse/dvc
|
|
131
|
+
.. _dvc-data: https://github.com/treeverse/dvc-data
|
|
@@ -5,7 +5,7 @@ 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
11
|
pytest<9,>=7
|
|
@@ -13,5 +13,5 @@ pytest-sugar
|
|
|
13
13
|
pytest-cov>=4.1.0
|
|
14
14
|
pytest-mock
|
|
15
15
|
pytest-benchmark
|
|
16
|
-
pytest-asyncio<
|
|
16
|
+
pytest-asyncio<2,>=0.23.2
|
|
17
17
|
reflink
|
|
@@ -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
|
|
File without changes
|