build(zarr-metadata): give the sdist an explicit include allowlist - #4248
Merged
Conversation
…ying around hatchling had no sdist configuration here either, so a source distribution carried everything in the package directory. Building from a working tree with scratch files in it put `.env.local`, a notebook and a `__scratch/` dump in the tarball. A tagged release builds from a fresh CI checkout and so was never actually at risk, but nothing made that a property of the package rather than of the runner. The list is derived from this package rather than copied from zarr-indexing, which needed `docs/snippets` and `examples/` because its suite executes them. Nothing here does: every fixture is a JSON file next to the test module that reads it, so `/tests` is the whole test dependency. `/docs` and `/mkdocs.yml` ride along because they are self-contained — mkdocstrings reads `src` and the config reaches nowhere outside the package — so the sdist documents itself as well as tests itself. `changes/` and `.readthedocs.yaml` are left out: towncrier fragments are repo bookkeeping, and the RTD config addresses paths from the repo root, where an unpacked sdist is not. Verified by unpacking the built sdist into a bare venv and working from there: 595 tests pass and `mkdocs build --strict` succeeds. Assisted-by: ClaudeCode:claude-opus-5
d-v-b
force-pushed
the
claude/zen-elgamal-331b96
branch
2 times, most recently
from
August 12, 2026 09:18
89e35fe to
13a1f9b
Compare
d-v-b
marked this pull request as ready for review
August 12, 2026 09:19
Contributor
Author
|
I will self-merge this when CI passes. |
d-v-b
added a commit
to d-v-b/zarr-python
that referenced
this pull request
Aug 14, 2026
…speak zarr-developers#4248 gave this package's sdist an explicit allowlist and merged without a news fragment, so a user-visible packaging change was about to miss the 0.5.0 notes. Add one. Filing it as `misc` exposed that towncrier's built-in `misc` type sets `showcontent = false`: the entry would render as a bare PR link, which tells a reader nothing. Restate all five types the `changes/README.md` menu offers — declaring any type replaces the built-in set — as the defaults verbatim except for `misc`, which now shows its content. A change worth a release note is worth a sentence, whatever its category. Assisted-by: ClaudeCode:claude-opus-5
d-v-b
added a commit
to d-v-b/zarr-python
that referenced
this pull request
Aug 14, 2026
Consume the pending news fragments — zarr-developers#4232's constant-naming-grammar removal note, zarr-developers#4264's note widening `JSONValue`'s array arm to the covariant `Sequence`, and zarr-developers#4248's sdist allowlist — into CHANGELOG.md via towncrier for the zarr_metadata-v0.5.0 release. Minor, not patch: the `JSONValue` widening changes a published type's meaning for every consumer that annotates against it, and zarr-developers#4232 removes the old version-last constant spellings outright. Assisted-by: ClaudeCode:claude-opus-5
d-v-b
added a commit
that referenced
this pull request
Aug 14, 2026
* chore(zarr-metadata): note the sdist allowlist, and let misc entries speak #4248 gave this package's sdist an explicit allowlist and merged without a news fragment, so a user-visible packaging change was about to miss the 0.5.0 notes. Add one. Filing it as `misc` exposed that towncrier's built-in `misc` type sets `showcontent = false`: the entry would render as a bare PR link, which tells a reader nothing. Restate all five types the `changes/README.md` menu offers — declaring any type replaces the built-in set — as the defaults verbatim except for `misc`, which now shows its content. A change worth a release note is worth a sentence, whatever its category. Assisted-by: ClaudeCode:claude-opus-5 * chore(zarr-metadata): build 0.5.0 changelog Consume the pending news fragments — #4232's constant-naming-grammar removal note, #4264's note widening `JSONValue`'s array arm to the covariant `Sequence`, and #4248's sdist allowlist — into CHANGELOG.md via towncrier for the zarr_metadata-v0.5.0 release. Minor, not patch: the `JSONValue` widening changes a published type's meaning for every consumer that annotates against it, and #4232 removes the old version-last constant spellings outright. Assisted-by: ClaudeCode:claude-opus-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
claude wrote this, original PR against my fork is here: d-v-b#284
this change ensures that we have an allowlist for the contents of the source distribution (sdist) when we publish. without this configuration, anything in the package root could get sucked into the sdist and then published, which opens a lot of bad outcomes.
Summary
build(zarr-metadata): the sdist ships an allowlist, not whatever is lying around
hatchling had no sdist configuration here either, so a source distribution carried everything in the package directory. Building from a working tree with scratch files in it put
.env.local, a notebook and a__scratch/dump in the tarball. A tagged release builds from a fresh CI checkout and so was never actually at risk, but nothing made that a property of the package rather than of the runner.The list is derived from this package rather than copied from zarr-indexing, which needed
docs/snippetsandexamples/because its suite executes them. Nothing here does: every fixture is a JSON file next to the test module that reads it, so/testsis the whole test dependency./docsand/mkdocs.ymlride along because they are self-contained — mkdocstrings readssrcand the config reaches nowhere outside the package — so the sdist documents itself as well as tests itself.changes/and.readthedocs.yamlare left out: towncrier fragments are repo bookkeeping, and the RTD config addresses paths from the repo root, where an unpacked sdist is not.Verified by unpacking the built sdist into a bare venv and working from there: 595 tests pass and
mkdocs build --strictsucceeds.Assisted-by: ClaudeCode:claude-opus-5
For reviewers
[What would you most value a second look at? What are you already confident in? For a refactor, say whether behavior is meant to be unchanged.]
Author attestation
TODO
docs/user-guide/*.mdchanges/