ci: drive build versions from docs/packages/<pkg>.yaml - #1937
Merged
Merged
Conversation
A version entry without tag/files is pending; _setup.yml turns the pending set (or a workflow_dispatch version glob) into a matrix that every job of a build workflow iterates over, and _publish-wheel.yml fills in tag/files through the docs PR. A push to main builds and publishes whatever is pending, so no manual dispatch is needed after a merge. Migrate build-ada-url.yml, build-cffi.yml and build-mlx.yml as pilots. Signed-off-by: Ludovic Henry <git@ludovic.dev>
Every build-<pkg>.yml and test-<pkg>.yml now calls _setup.yml with its package name, iterates every job over matrix.version, keys artifacts and the publish pattern on it, and triggers on pull_request, push to main and a workflow_dispatch version glob instead of a version literal. Jobs cannot pass per-leg values through outputs, so the sdist->bdist workflows name the sdist artifact after the version instead. Workflows whose git tag differs from the wheel version (v-prefixed tags, rtoml, fabio, dprint-py, point-cloud-utils, torch's +cpu) derive the tag from the version; their patch directories follow the wheel version. Signed-off-by: Ludovic Henry <git@ludovic.dev>
check_versions.py appends a bare '- version:' entry to docs/packages/<pkg>.yaml and opens the PR; the PR's own pull_request run builds it, so pr-trigger.yml and the workflow_dispatch calls go away. pr-checks.yml lints changed package YAMLs and requires one for every changed build workflow. Signed-off-by: Ludovic Henry <git@ludovic.dev>
Signed-off-by: Ludovic Henry <git@ludovic.dev>
luhenry
marked this pull request as ready for review
September 16, 2026 09:59
Contributor
|
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.
docs/packages/<pkg>.yamlbecomes the source of truth for what a workflow builds. A- version:entry withouttag:/files:is pending;_setup.ymlturns the pending set into amatrix.versionevery job iterates over, and_publish-wheel.ymlfills the entry in through the docs PR. Adding a package is two files (build-<pkg>.yml+docs/packages/<pkg>.yaml); upgrading one is a single- version:line.Triggers
pull_request(tomain) on the workflow and its YAML: builds every pending version, dry-runs the publish.pushtomain: builds and publishes every pending version — replaces the manual post-merge dispatch. Merging the docs PR pushes an all-released YAML, so that run has an empty matrix and skips every job (green).workflow_dispatchtakes a version glob (2.5.*), released or not, for force-rebuilds.Infra
_setup.yml:package(required) +version(glob) inputs; runs the newci_scripts/pending_versions.pyviauv run, outputsversionsas JSON. The script also lints the YAML (tag/files pairing, duplicates).update_doc.py: fills the declared entry in place (byte-for-byte otherwise); fails when the wheel's version is not declared (setuptools_scm dev versions no longer get documented) or the YAML is missing; still registers first-time packages inpackages.txt.generate_packages_doc.py: pending versions are skipped by the docs and the Simple API instead of raising.check_versions.py: upgrade PRs append- version:lines and nothing else — no workflow bump, noTrigger:lines, no dispatch.pr-trigger.ymlis deleted.pr-checks.yml: lints changed package YAMLs and requires one for every changed build workflow.Workflows (707
build-*.yml, 3test-*.yml)Mechanically rewritten:
${{ inputs.version || '<lit>' }}→${{ matrix.version }}, workflow-level<PKG>_VERSIONenv moved to job level,if: needs.setup.outputs.versions != '[]'+version:matrix vector on every job (GHA rejects an empty matrix). Hand-finished:<pkg>-<version>-sdistand consumers resolve it with asdist_pathstep.v-prefixed defaults move thevintoref:(their patch dirs renamed to the bare version); rtoml/dprint-py/point-cloud-utils/fabio/torch derive the tag from the version in a step.build-mlx.yml/build-polars-runtime.ymlbuild two packages; they pass the primary one and the sibling YAML must be kept in lockstep (commented).Verified on this branch
pull_requestrun: setup only, build/publish skipped, green.gh workflow run build-ada-url.yml -f version='4.0.*'andbuild-cffi.yml -f version=2.1.0: matrix expands, wheels build, publish dry-run showsupdate_doc.pyreplacing the tag of the already-released entry.pending_versions.py,update_doc.py(pending / released / undeclared / mid-file entry) andgenerate_packages_doc.pyexercised locally;check_versions.py --self-testpasses; actionlint reports nothing new versusmain.Known limitation: a second push touching a package's YAML before its docs PR lands rebuilds the still-pending version and creates a second release;
update_doc.pykeeps the latest tag.