Repository navigation
build: ground sub-package packaging in current uv/hatch/setuptools-scm guidance - #4407
Merged
d-v-b merged 8 commits intoSep 25, 2026
Merged
Conversation
…rr from just
The packages reached in-repo zarr two different ways: zarr-http-server
pinned it with `[tool.uv.sources] zarr = { path = "../.." }` in
pyproject.toml, and zarr-indexing ran its tests in the repo root's
environment (`uv run --project ../..`). Both reach outside the package, so
neither package's unpacked sdist could run its own `just test`.
Now every package's pyproject.toml stands alone, and the justfiles add
the in-repo zarr as an editable overlay (`--with-editable ../..`) only
when ../.. is the repository. From an sdist there is no overlay:
zarr-http-server resolves zarr from PyPI, and zarr-indexing's zarr suites
skip. zarr-metadata needs no zarr and is unchanged.
zarr-http-server's uv.lock now resolves zarr from PyPI, and zarr-indexing
CI syncs the package environment instead of the root one.
Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
…uv.lock setuptools-scm deprecates the top-level `git_describe_command` in favour of `scm.git.describe_command` (a DeprecationWarning builds swallow). Move the root and all three sub-packages to the new key; hatch-vcs passes raw-options to setuptools_scm.get_version, which accepts `scm` from setuptools-scm 9.0 (8.4, which the docs name, was never released), so require setuptools-scm>=9 at build time. Computed versions are unchanged. `tag.prefix`, setuptools-scm's documented monorepo option, is not reachable through hatch-vcs 0.5.0: get_version() takes no `tag` argument. uv's docs say uv.lock "should be checked into version control", with no library exception, and the other two sub-packages already commit theirs. Stop ignoring zarr-metadata's. Assisted-by: ClaudeCode:claude-opus-5-5
`hatch build` builds the wheel from the source tree, so nothing exercised the sdist: zarr-developers#4229's first cut shipped sdists whose symlinks pip refuses to unpack, and the release workflows would have uploaded them. The test_artifacts job now builds a wheel from the sdist with pip, then runs the package's `just test` and `just docs-check` from the unpacked sdist. The job has no checkout, so zarr (for zarr-http-server) resolves from PyPI, which also covers the `zarr>=3.1` floor that repo runs, overlaying in-repo zarr, never check. Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
…pers#4229 Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
d-v-b
force-pushed
the
chore/subpackage-packaging-practices
branch
from
September 25, 2026 06:26
c027cac to
00d6643
Compare
d-v-b
marked this pull request as ready for review
September 25, 2026 06:32
1 task
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.
this is a refresh of our subpackaging structure. The biggest fact on display here is that we don't want to use hatch / uv monorepo features (yet) because our projects don't have the exact same python support range.
🤖 AI text below 🤖
Depends on #4406 and includes its commits; merge that first, after which this diff shrinks to the last five commits. (GitHub can't natively stack PRs whose head branches live on a fork.)
Summary
I checked our monorepo packaging against the current docs for uv (0.12.18), Hatch (1.18.1) / hatchling (1.32.4), setuptools-scm (10.3.4), hatch-vcs (0.5.0), and the PyPA sdist spec. This PR fixes the three gaps that were worth fixing.
1. Test each sdist on its own before release (
ci:)hatch buildbuilds the wheel from the source tree, so nothing ever used the sdist. The first version of #4229 produced sdists that pip refuses to unpack (a symlink pointing outside the archive), and the release workflows would have uploaded them. Each release workflow'stest_artifactsjob now:pip wheel), which unpacks under the sdist format rules: no links out of the archive;just testandjust docs-checkfrom the unpacked sdist, with no repo checkout.The job has no checkout, so zarr-http-server resolves
zarrfrom PyPI there. That also covers thezarr>=3.1floor, which repo runs never check:uv run --with-editableversions are "respected regardless of the project's requirements".2. Replace deprecated
git_describe_command(build:)setuptools-scm deprecates
git_describe_commandin favour ofscm.git.describe_command. The DeprecationWarning is swallowed during builds. This moves the root and all three sub-packages to the new key and addssetuptools-scm>=9tobuild-system.requires. hatch-vcs passesraw-optionstosetuptools_scm.get_version(), which only acceptsscmfrom 9.0; 8.4, the version the docs name, was never released.tag.prefixis setuptools-scm's documented option for monorepos, but hatch-vcs 0.5.0 can't reach it (get_version()takes notagargument).tag_regexdeprecation warning comes from hatch-vcs's own translation oftag-pattern, so we can't fix it from our config.zarrfrom source now needssetuptools-scm>=9; e.g. the conda-forge recipe's host requirements.3. Commit zarr-metadata's
uv.lock.gitignoreexcluded it ("a library, not an app"). uv's docs sayuv.lock"should be checked into version control", with no exception for libraries, and the other two sub-packages already commit theirs.Checked, no change needed
requires-python(ours differ: 3.11 vs 3.12), and each package releases independently.tool.uv.sources(chore: keep sub-package pyproject.toml standalone; overlay in-repo zarr from just #4406): matches uv's publishing advice to verify with--no-sources.sources/ Hatch workspaces: could replace the justfile overlay, but the sub-packages run on uv + just, not Hatch envs, so switching gains nothing.Verification
hatch versionfor root / zarr-metadata / zarr-indexing / zarr-http-server, before vs afterscm=TypeError, hence>=9just testfrom unpacked sdistsjust docs-checkfrom unpacked sdists--strictI haven't run the release workflows: on the fork,
workflow_dispatchwould also trigger the TestPyPI upload job.The zarr-metadata lock is generated against the docs pins #4229 aligned.
🤖 Generated with Claude Code