Skip to content

Commit dd3c1e3

Browse files
mkitticlaude
andcommitted
Fix docs, pre-commit, wheel, and coverage CI for the backport branch
- .readthedocs.yaml: bump build image to ubuntu-24.04 (ubuntu-20.04 was removed by Read the Docs) and cap docs zarr to <3.1, matching the 0.15.x compatibility range. - .pre-commit-config.yaml: pin the mypy hook's zarr to >=3.0.0rc1,<3.1 so type checking runs against the zarr 3.0 API that numcodecs.zarr3 targets (the unpinned hook pulled zarr 3.2, whose ZDType broke mypy). - zarr3.py: correct two `# type: ignore[arg-type]` to `[call-overload]` for np.dtype(astype) under current numpy. - wheel.yaml: swap the stalled macos-13 intel runner for macos-15-large, matching ci.yaml. - codecov.yml / pyproject.toml: exclude test files from coverage (ignore: tests/** and [tool.coverage.run] omit), matching main. - test_zarr3.py: cover AsType.evolve_from_array_spec when decode_dtype is unset, bringing zarr3.py to 100%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7ae0f4b commit dd3c1e3

8 files changed

Lines changed: 15 additions & 7 deletions

File tree

.github/codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ coverage:
77
patch:
88
default:
99
target: 100
10+
ignore:
11+
- "tests/**"
1012
comment:
1113
layout: "diff, files"
1214
behavior: default

.github/workflows/wheel.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
# macos-13 is an intel runner, macos-14 is a arm64 runner
17-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
16+
# macos-15-large is an intel runner, macos-14 is an arm64 runner
17+
os: [ubuntu-latest, windows-latest, macos-15-large, macos-14]
1818
env:
1919
CIBW_TEST_COMMAND: python -c "import numcodecs"
2020
CIBW_BUILD: "cp311-* cp312-* cp313-*"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ repos:
3030
hooks:
3131
- id: mypy
3232
args: [--config-file, pyproject.toml]
33-
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0rc1']
33+
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0rc1,<3.1']

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ submodules:
44
include: all
55

66
build:
7-
os: ubuntu-20.04
7+
os: ubuntu-24.04
88
tools:
99
python: "3.12"
1010
jobs:
1111
post_install:
12-
- python -m pip install --pre 'zarr>=3.0.0b2'
12+
- python -m pip install --pre 'zarr>=3.0.0b2,<3.1'
1313

1414
sphinx:
1515
configuration: docs/conf.py

numcodecs/tests/test_pyzstd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44
import pytest
55
import pyzstd
6+
67
from numcodecs.zstd import Zstd
78

89
test_data = [

numcodecs/tests/test_zarr3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ def test_generic_compressor(
9292
(numcodecs.zarr3.FixedScaleOffset, {"offset": 0, "scale": 25.5}),
9393
(numcodecs.zarr3.FixedScaleOffset, {"offset": 0, "scale": 51, "astype": "uint16"}),
9494
(numcodecs.zarr3.AsType, {"encode_dtype": "float32", "decode_dtype": "float32"}),
95+
(numcodecs.zarr3.AsType, {"encode_dtype": "float32"}),
9596
],
9697
ids=[
9798
"delta",
9899
"fixedscaleoffset",
99100
"fixedscaleoffset2",
100101
"astype",
102+
"astype_no_decode_dtype",
101103
],
102104
)
103105
def test_generic_filter(

numcodecs/zarr3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def __init__(self, **codec_config: dict[str, JSON]) -> None:
286286

287287
def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
288288
if astype := self.codec_config.get("astype"):
289-
return replace(chunk_spec, dtype=np.dtype(astype)) # type: ignore[arg-type]
289+
return replace(chunk_spec, dtype=np.dtype(astype)) # type: ignore[call-overload]
290290
return chunk_spec
291291

292292

@@ -304,7 +304,7 @@ def __init__(self, **codec_config: JSON) -> None:
304304

305305
def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
306306
if astype := self.codec_config.get("astype"):
307-
return replace(chunk_spec, dtype=np.dtype(astype)) # type: ignore[arg-type]
307+
return replace(chunk_spec, dtype=np.dtype(astype)) # type: ignore[call-overload]
308308
return chunk_spec
309309

310310
def evolve_from_array_spec(self, array_spec: ArraySpec) -> FixedScaleOffset:

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ write_to = "numcodecs/version.py"
118118
skip = "./.git,fixture"
119119
ignore-words-list = "ba, compiletime, hist, nd, unparseable"
120120

121+
[tool.coverage.run]
122+
omit = ["tests/*"]
123+
121124
[tool.coverage.report]
122125
exclude_lines = [
123126
"pragma: no cover",

0 commit comments

Comments
 (0)