Skip to content

Commit c453bdf

Browse files
authored
Merge branch 'main' into ig/fix_zip_store
2 parents 069d599 + 037adf6 commit c453bdf

File tree

16 files changed

+148
-27
lines changed

16 files changed

+148
-27
lines changed

.github/workflows/hypothesis.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ jobs:
6969
path: .hypothesis/
7070
key: cache-hypothesis-${{ runner.os }}-${{ github.run_id }}
7171

72+
- name: Upload coverage
73+
uses: codecov/codecov-action@v5
74+
with:
75+
token: ${{ secrets.CODECOV_TOKEN }}
76+
verbose: true # optional (default = false)
77+
7278
- name: Generate and publish the report
7379
if: |
7480
failure()

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ ci:
66
default_stages: [pre-commit, pre-push]
77
repos:
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.9.1
9+
rev: v0.9.4
1010
hooks:
1111
- id: ruff
1212
args: ["--fix", "--show-fixes"]
1313
- id: ruff-format
1414
- repo: https://github.com/codespell-project/codespell
15-
rev: v2.3.0
15+
rev: v2.4.1
1616
hooks:
1717
- id: codespell
1818
args: ["-L", "fo,ihs,kake,te", "-S", "fixture"]
@@ -37,7 +37,7 @@ repos:
3737
# Tests
3838
- pytest
3939
- repo: https://github.com/scientific-python/cookie
40-
rev: 2024.08.19
40+
rev: 2025.01.22
4141
hooks:
4242
- id: sp-repo-review
4343
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -50,6 +50,6 @@ repos:
5050
hooks:
5151
- id: numpydoc-validation
5252
- repo: https://github.com/twisted/towncrier
53-
rev: 23.11.0
53+
rev: 24.8.0
5454
hooks:
5555
- id: towncrier-check

changes/2778.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use removeprefix rather than replace when removing filename prefixes in `FsspecStore.list`

changes/2796.chore.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The docs environment is now built with ``astroid`` pinned to a version less than 4. This allows the docs to build in CI.

changes/2801.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure utf8 compliant strings are used to construct numpy arrays in property-based tests

changes/2804.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:py:class:`LocalStore` learned to ``delete_dir``. This makes array and group deletes more efficient.

changes/2807.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix pickling for ZipStore

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ docs = [
103103
'numcodecs[msgpack]',
104104
'rich',
105105
's3fs',
106+
'astroid<4'
106107
]
107108

108109

@@ -160,7 +161,7 @@ run = "run-coverage --no-cov"
160161
run-pytest = "run"
161162
run-verbose = "run-coverage --verbose"
162163
run-mypy = "mypy src"
163-
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
164+
run-hypothesis = "run-coverage --hypothesis-profile ci --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*"
164165
list-env = "pip list"
165166

166167
[tool.hatch.envs.doctest]
@@ -397,7 +398,8 @@ filterwarnings = [
397398
"ignore:.*is currently not part in the Zarr format 3 specification.*:UserWarning",
398399
]
399400
markers = [
400-
"gpu: mark a test as requiring CuPy and GPU"
401+
"gpu: mark a test as requiring CuPy and GPU",
402+
"slow_hypothesis: slow hypothesis tests",
401403
]
402404

403405
[tool.repo-review]
@@ -427,3 +429,6 @@ directory = 'changes'
427429
filename = "docs/release-notes.rst"
428430
underlines = ["-", "~", "^"]
429431
issue_format = ":issue:`{issue}`"
432+
433+
[tool.codespell]
434+
ignore-words-list = "astroid"

src/zarr/storage/_fsspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ async def set_partial_values(
341341
async def list(self) -> AsyncIterator[str]:
342342
# docstring inherited
343343
allfiles = await self.fs._find(self.path, detail=False, withdirs=False)
344-
for onefile in (a.replace(self.path + "/", "") for a in allfiles):
344+
for onefile in (a.removeprefix(self.path + "/") for a in allfiles):
345345
yield onefile
346346

347347
async def list_dir(self, prefix: str) -> AsyncIterator[str]:

src/zarr/storage/_local.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ async def delete(self, key: str) -> None:
208208
else:
209209
await asyncio.to_thread(path.unlink, True) # Q: we may want to raise if path is missing
210210

211+
async def delete_dir(self, prefix: str) -> None:
212+
# docstring inherited
213+
self._check_writable()
214+
path = self.root / prefix
215+
if path.is_dir():
216+
shutil.rmtree(path)
217+
elif path.is_file():
218+
raise ValueError(f"delete_dir was passed a {prefix=!r} that is a file")
219+
else:
220+
# Non-existent directory
221+
# This path is tested by test_group:test_create_creates_parents for one
222+
pass
223+
211224
async def exists(self, key: str) -> bool:
212225
# docstring inherited
213226
path = self.root / key

0 commit comments

Comments
 (0)