Skip to content

fix: adapt to zarr-metadata 0.4 type renames - #113

Merged
d-v-b merged 4 commits into
developmentseed:mainfrom
d-v-b:claude/zarrista-zarr-metadata-0-4-69102a
Jul 30, 2026
Merged

fix: adapt to zarr-metadata 0.4 type renames#113
d-v-b merged 4 commits into
developmentseed:mainfrom
d-v-b:claude/zarrista-zarr-metadata-0-4-69102a

Conversation

@d-v-b

@d-v-b d-v-b commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Summary

zarr-metadata 0.4.0 renames its TypedDict document types — the format version moves to the front of the name and the JSON-document form gets a JSON suffix. The old names are removed, not aliased, so the previous stubs break against it.

This PR renames every affected use in the .pyi stubs (and in the tests added on main), bumps the dependency to zarr-metadata>=0.4, and locks 0.4.0:

Old name New name
ArrayMetadataV3 ZarrV3ArrayMetadataJSON
GroupMetadataV3 ZarrV3GroupMetadataJSON
ConsolidatedMetadataV3 ZarrV3ConsolidatedMetadataJSON
NamedConfigV3 ZarrV3NamedConfigJSON

JSONValue and the zarr_metadata.v3.data_type name literals (Float32DataTypeName, ...) are unchanged in 0.4, so those imports stay as they are. The Rust side is untouched — zarrs::metadata::v3::{ArrayMetadataV3, ...} are unrelated zarrs crate types.

Note on the lockfile: uv lock also resolved the pyodide dependency group, which had been added to pyproject.toml without re-locking, so the lock diff includes those packages too.

Verification

  • uv sync + maturin develop + pytest against zarr-metadata 0.4.0 from PyPI: 110 passed.
  • A script checked that every name imported from zarr_metadata in the stubs and tests resolves against 0.4.0.
  • ruff check and ruff format --check pass.

Closes #112

d-v-b added 3 commits July 29, 2026 22:10
zarr-metadata 0.4.0 renames its TypedDict document types, putting the
format version at the front of the name and marking the JSON-document
form with a `JSON` suffix; the old names are removed, not aliased
(zarr-developers/zarr-python#4211). Update the stubs accordingly:

- ArrayMetadataV3 -> ZarrV3ArrayMetadataJSON
- GroupMetadataV3 -> ZarrV3GroupMetadataJSON
- ConsolidatedMetadataV3 -> ZarrV3ConsolidatedMetadataJSON
- NamedConfigV3 -> ZarrV3NamedConfigJSON

and require zarr-metadata >= 0.4. `JSONValue` and the
`zarr_metadata.v3.data_type` name literals are unchanged.

uv.lock still pins 0.3.0: 0.4.0 is not on PyPI yet, so the lockfile
must be regenerated (`uv lock -P zarr-metadata`) once it is released.

Assisted-by: ClaudeCode:claude-fable-5
Resolves conflicts in _array.pyi and _builder.pyi by keeping upstream's
new content (fill_value property, expanded docstrings) with the
zarr-metadata 0.4 type names, and renames ArrayMetadataV3 ->
ZarrV3ArrayMetadataJSON in the tests upstream added.

Assisted-by: ClaudeCode:claude-fable-5
Regenerated with `uv lock -P zarr-metadata` now that 0.4.0 is on PyPI.
This also resolves the `pyodide` dependency group, which was missing
from the lockfile (it was added to pyproject.toml without re-locking).

Assisted-by: ClaudeCode:claude-fable-5
@d-v-b
d-v-b marked this pull request as ready for review July 29, 2026 20:39
@d-v-b

d-v-b commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

looks like ruff 0.16 is stricter, and the python lint job is pulling that in via the ruff action. @kylebarron do you want me to make these stricter linting checks pass in a separate PR?

@kylebarron

Copy link
Copy Markdown
Member

ah, I've been updating a bunch of my repos for ruff 0.16

@kylebarron

Copy link
Copy Markdown
Member

fixed CI in #114

Resolves the uv.lock conflict by regenerating the lockfile from
upstream's version (which now includes the ruff 0.16 bump and the
pyodide group), re-applying the zarr-metadata 0.4.0 update.

Assisted-by: ClaudeCode:claude-fable-5
@kylebarron

Copy link
Copy Markdown
Member

Feel free to merge if it looks good to you

@d-v-b
d-v-b merged commit f7cac0f into developmentseed:main Jul 30, 2026
13 checks passed
@d-v-b
d-v-b deleted the claude/zarrista-zarr-metadata-0-4-69102a branch July 30, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

handle zarr-metadata 0.4.0

2 participants