build(zarr-metadata): give the sdist an explicit include allowlist - #284
Closed
d-v-b wants to merge 1 commit into
Closed
build(zarr-metadata): give the sdist an explicit include allowlist#284d-v-b wants to merge 1 commit into
d-v-b wants to merge 1 commit into
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
from
August 12, 2026 09:09
2f6aa8b to
13a1f9b
Compare
Merged
7 tasks
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
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.
🤖 AI text below 🤖
packages/zarr-metadata/pyproject.tomlconfigures the wheel target but not the sdist, so a source distribution carries whatever is sitting in the package directory. Mirrors the fix 8be98fa applied tozarr-indexingin zarr-developers#4222.Hatchling's default is not "ship everything" — it honors
.gitignore. That makes it a denylist, which fails precisely for scratch files whose names nobody anticipated. Building from a dirty tree put.env.local,debug_dump.ipynb,scratch_notes.mdand__scratch/dump.jsonin the tarball, while a.pycwas correctly excluded. A tagged release builds from a fresh CI checkout, so nothing junk has actually shipped — but that was a property of the runner, not of the package.The list
Derived from this package rather than copied from
zarr-indexing, whose list includes/examplesanddocs/snippetsbecausetest_doc_examples.pyexecutes them. Nothing here does: every fixture is a JSON file next to the test module that reads it (Path(__file__).parent / ...), and there is noconftest.py, so/testsis the whole test dependency.Two judgment calls worth flagging for review:
/docsand/mkdocs.ymlincluded despite no test touching them. The site is self-contained — mkdocstrings readspaths: [src], nothing reaches outside the package — so the shippedjustfile'sdocs-checkrecipe still works from an unpacked sdist. 120K against 768K of tests.changes/and.readthedocs.yamlexcluded. Towncrier fragments are repo bookkeeping, and the RTD config addresses paths from the repo root, where an unpacked sdist is not.Verification
Dirtied the tree with four scratch files and built both ways:
Then unpacked the tarball into
/tmp, installed it into a bare venv, and worked from the unpacked directory:pytest— 595 passed, importing fromsite-packagesrather than the source treemkdocs build --strict— succeedsPKG-INFOwith no git repo present, so wheel-from-sdist builds fineNo towncrier fragment, matching the
zarr-indexingprecedent — nothing here is observable to a consumer of the library. Happy to add one if you'd rather it be noted.