dvc-objects 5.1.2__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.
Files changed (52) hide show
  1. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.cruft.json +2 -2
  2. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.github/workflows/release.yml +3 -3
  3. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.github/workflows/tests.yml +1 -3
  4. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.github/workflows/update-template.yaml +1 -1
  5. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.pre-commit-config.yaml +1 -1
  6. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/CONTRIBUTING.rst +3 -3
  7. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/LICENSE +1 -1
  8. {dvc_objects-5.1.2/src/dvc_objects.egg-info → dvc_objects-5.2.0}/PKG-INFO +12 -12
  9. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/README.rst +7 -7
  10. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/pyproject.toml +5 -4
  11. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/base.py +46 -5
  12. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/system.py +1 -1
  13. {dvc_objects-5.1.2 → dvc_objects-5.2.0/src/dvc_objects.egg-info}/PKG-INFO +12 -12
  14. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/requires.txt +1 -1
  15. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/test_localfs.py +27 -0
  16. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.gitattributes +0 -0
  17. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.github/dependabot.yml +0 -0
  18. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/.gitignore +0 -0
  19. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/CODE_OF_CONDUCT.rst +0 -0
  20. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/noxfile.py +0 -0
  21. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/setup.cfg +0 -0
  22. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/__init__.py +0 -0
  23. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/compat.py +0 -0
  24. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/db.py +0 -0
  25. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/errors.py +0 -0
  26. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/executors.py +0 -0
  27. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/__init__.py +0 -0
  28. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/callbacks.py +0 -0
  29. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/errors.py +0 -0
  30. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/generic.py +0 -0
  31. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/local.py +0 -0
  32. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/memory.py +0 -0
  33. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/scheme.py +0 -0
  34. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/fs/utils.py +0 -0
  35. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/obj.py +0 -0
  36. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/py.typed +0 -0
  37. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects/transfer.py +0 -0
  38. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/SOURCES.txt +0 -0
  39. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/dependency_links.txt +0 -0
  40. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/src/dvc_objects.egg-info/top_level.txt +0 -0
  41. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/__init__.py +0 -0
  42. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/benchmarks/__init__.py +0 -0
  43. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/benchmarks/test_fs.py +0 -0
  44. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/conftest.py +0 -0
  45. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/__init__.py +0 -0
  46. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/test_callbacks.py +0 -0
  47. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/test_generic.py +0 -0
  48. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/test_system.py +0 -0
  49. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/fs/test_utils.py +0 -0
  50. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/test_odb.py +0 -0
  51. {dvc_objects-5.1.2 → dvc_objects-5.2.0}/tests/test_reflink.py +0 -0
  52. {dvc_objects-5.1.2 → 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": "Iterative",
10
+ "author": "Treeverse",
11
11
  "email": "support@dvc.org",
12
- "github_user": "iterative",
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@v5
20
+ uses: actions/checkout@v6
21
21
  with:
22
22
  fetch-depth: 0
23
23
 
24
- - name: Set up Python 3.13
24
+ - name: Set up Python 3.14
25
25
  uses: actions/setup-python@v6
26
26
  with:
27
- python-version: '3.13'
27
+ python-version: '3.14'
28
28
 
29
29
  - name: Upgrade pip and nox
30
30
  run: |
@@ -22,12 +22,10 @@ jobs:
22
22
  matrix:
23
23
  os: [ubuntu-latest, windows-latest, macos-latest]
24
24
  pyv: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
25
- include:
26
- - {os: ubuntu-latest, pyv: 'pypy3.9'}
27
25
 
28
26
  steps:
29
27
  - name: Check out the repository
30
- uses: actions/checkout@v5
28
+ uses: actions/checkout@v6
31
29
  with:
32
30
  fetch-depth: 0
33
31
 
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
12
  - name: Check out the repository
13
- uses: actions/checkout@v5
13
+ uses: actions/checkout@v6
14
14
 
15
15
  - name: Update template
16
16
  uses: iterative/py-template@main
@@ -20,7 +20,7 @@ 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.13.1'
23
+ rev: 'v0.14.9'
24
24
  hooks:
25
25
  - id: ruff-check
26
26
  args: [--fix, --exit-non-zero-on-fix]
@@ -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/iterative/dvc-objects
16
- .. _Issue Tracker: https://github.com/iterative/dvc-objects/issues
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/iterative/dvc-objects/pulls
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 2022 Iterative.
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.1.2
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: Iterative <support@dvc.org>
5
+ Author-email: Treeverse <support@dvc.org>
6
6
  License-Expression: Apache-2.0
7
- Project-URL: Issues, https://github.com/iterative/dvc-objects/issues
8
- Project-URL: Source, https://github.com/iterative/dvc-objects
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
@@ -29,7 +29,7 @@ Requires-Dist: pytest-asyncio<2,>=0.23.2; extra == "tests"
29
29
  Requires-Dist: reflink; extra == "tests"
30
30
  Provides-Extra: dev
31
31
  Requires-Dist: dvc-objects[tests]; extra == "dev"
32
- Requires-Dist: mypy==1.18.2; extra == "dev"
32
+ Requires-Dist: mypy==1.19.1; extra == "dev"
33
33
  Dynamic: license-file
34
34
 
35
35
  DVC objects
@@ -51,11 +51,11 @@ DVC objects
51
51
  .. |License| image:: https://img.shields.io/pypi/l/dvc-objects
52
52
  :target: https://opensource.org/licenses/Apache-2.0
53
53
  :alt: License
54
- .. |Tests| image:: https://github.com/iterative/dvc-objects/workflows/Tests/badge.svg
55
- :target: https://github.com/iterative/dvc-objects/actions?workflow=Tests
54
+ .. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
55
+ :target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
56
56
  :alt: Tests
57
- .. |Codecov| image:: https://codecov.io/gh/iterative/dvc-objects/branch/main/graph/badge.svg
58
- :target: https://app.codecov.io/gh/iterative/dvc-objects
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
59
59
  :alt: Codecov
60
60
  .. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
61
61
  :target: https://github.com/pre-commit/pre-commit
@@ -123,9 +123,9 @@ please `file an issue`_ along with a detailed description.
123
123
 
124
124
  .. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
125
125
  .. _PyPI: https://pypi.org/
126
- .. _file an issue: https://github.com/iterative/dvc-objects/issues
126
+ .. _file an issue: https://github.com/treeverse/dvc-objects/issues
127
127
  .. _pip: https://pip.pypa.io/
128
128
  .. github-only
129
129
  .. _Contributor Guide: CONTRIBUTING.rst
130
- .. _dvc: https://github.com/iterative/dvc
131
- .. _dvc-data: https://github.com/iterative/dvc-data
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/iterative/dvc-objects/workflows/Tests/badge.svg
21
- :target: https://github.com/iterative/dvc-objects/actions?workflow=Tests
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/iterative/dvc-objects/branch/main/graph/badge.svg
24
- :target: https://app.codecov.io/gh/iterative/dvc-objects
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/iterative/dvc-objects/issues
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/iterative/dvc
97
- .. _dvc-data: https://github.com/iterative/dvc-data
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
- authors = [{ name = "Iterative", email = "support@dvc.org" }]
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",
@@ -28,8 +29,8 @@ dependencies = [
28
29
  ]
29
30
 
30
31
  [project.urls]
31
- Issues = "https://github.com/iterative/dvc-objects/issues"
32
- Source = "https://github.com/iterative/dvc-objects"
32
+ Issues = "https://github.com/treeverse/dvc-objects/issues"
33
+ Source = "https://github.com/treeverse/dvc-objects"
33
34
 
34
35
  [project.optional-dependencies]
35
36
  tests = [
@@ -43,7 +44,7 @@ tests = [
43
44
  ]
44
45
  dev = [
45
46
  "dvc-objects[tests]",
46
- "mypy==1.18.2",
47
+ "mypy==1.19.1",
47
48
  ]
48
49
 
49
50
  [tool.setuptools.packages.find]
@@ -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
- def info(self, path, callback=DEFAULT_CALLBACK, batch_size=None, **kwargs):
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
- return self.fs.info(path, **kwargs)
590
- callback.set_size(len(path))
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
- func = partial(self.fs.info, **kwargs)
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(func, path)
647
+ it = executor.map(info_func, path)
607
648
  return list(callback.wrap(it))
608
649
 
609
650
  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/iterative/dvc/issues/10875
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
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dvc-objects
3
- Version: 5.1.2
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: Iterative <support@dvc.org>
5
+ Author-email: Treeverse <support@dvc.org>
6
6
  License-Expression: Apache-2.0
7
- Project-URL: Issues, https://github.com/iterative/dvc-objects/issues
8
- Project-URL: Source, https://github.com/iterative/dvc-objects
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
@@ -29,7 +29,7 @@ Requires-Dist: pytest-asyncio<2,>=0.23.2; extra == "tests"
29
29
  Requires-Dist: reflink; extra == "tests"
30
30
  Provides-Extra: dev
31
31
  Requires-Dist: dvc-objects[tests]; extra == "dev"
32
- Requires-Dist: mypy==1.18.2; extra == "dev"
32
+ Requires-Dist: mypy==1.19.1; extra == "dev"
33
33
  Dynamic: license-file
34
34
 
35
35
  DVC objects
@@ -51,11 +51,11 @@ DVC objects
51
51
  .. |License| image:: https://img.shields.io/pypi/l/dvc-objects
52
52
  :target: https://opensource.org/licenses/Apache-2.0
53
53
  :alt: License
54
- .. |Tests| image:: https://github.com/iterative/dvc-objects/workflows/Tests/badge.svg
55
- :target: https://github.com/iterative/dvc-objects/actions?workflow=Tests
54
+ .. |Tests| image:: https://github.com/treeverse/dvc-objects/workflows/Tests/badge.svg
55
+ :target: https://github.com/treeverse/dvc-objects/actions?workflow=Tests
56
56
  :alt: Tests
57
- .. |Codecov| image:: https://codecov.io/gh/iterative/dvc-objects/branch/main/graph/badge.svg
58
- :target: https://app.codecov.io/gh/iterative/dvc-objects
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
59
59
  :alt: Codecov
60
60
  .. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
61
61
  :target: https://github.com/pre-commit/pre-commit
@@ -123,9 +123,9 @@ please `file an issue`_ along with a detailed description.
123
123
 
124
124
  .. _Apache 2.0 license: https://opensource.org/licenses/Apache-2.0
125
125
  .. _PyPI: https://pypi.org/
126
- .. _file an issue: https://github.com/iterative/dvc-objects/issues
126
+ .. _file an issue: https://github.com/treeverse/dvc-objects/issues
127
127
  .. _pip: https://pip.pypa.io/
128
128
  .. github-only
129
129
  .. _Contributor Guide: CONTRIBUTING.rst
130
- .. _dvc: https://github.com/iterative/dvc
131
- .. _dvc-data: https://github.com/iterative/dvc-data
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.18.2
8
+ mypy==1.19.1
9
9
 
10
10
  [tests]
11
11
  pytest<9,>=7
@@ -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