Repository navigation
Support dynamic Python build matrices - #3541
Conversation
1ca9f20 to
f7c4321
Compare
|
Can't we get the list of python configuration we should build in Then in |
I really like the idea of having that info in |
| python-matrix: | ||
| description: Also compute the matrix output, querying PyPI for the interpreters upstream builds each version for. | ||
| required: false | ||
| default: false |
There was a problem hiding this comment.
The idea was to set it to false by default as part of a gradual rollout to our workflows - the skills/ directory gives the LLM instructions for converting workflows to use a dynamic matrix as it updates them to build new versions. That way existing workflows keep working as expected until there's a reason to trigger them again.
There was a problem hiding this comment.
For the transition, can't we simply generate it all the time and simply ignore the output in the workflows that haven't migrated yet?
There was a problem hiding this comment.
@luhenry I've reworked it so that a matrix is always generated, but it's ignored if python-versions is missing because we're manually specifying a version list.
I like that idea. I'll work on a change to do that instead.
|
f7c4321 to
4e76952
Compare
|
Updated to address most feedback. Still left the questions about default versions to exclude and default python-matrix state. |
|
@threexc LGTM. Only question is around how do we migrate the |
4e76952 to
3add317
Compare
There's a section added in Do you think more is needed? I wanted to avoid an immediate rewrite to all of the existing workflows. |
|
Rebased the PR and fixed conflicts. |
a88cfb7 to
d66bc45
Compare
|
GitHub says this was updated ~3h ago, but I see nothing new... rebasing anyway. |
python-wheels currently has a narrow, manually-set list of Python versions to build for, but this is often at odds with upstream projects. Instead, have check_versions.py record the Python versions upstream builds each release for (from its wheels on PyPI) as python-versions in the package's docs/packages/ file when declaring new versions, and add a --python-versions option to fill them in for entries added by hand. pending_versions.py then builds the workflow matrix from that data, with no network access. Versions without python-versions are left out of the matrix with a warning rather than failing, so workflows that don't use the matrix yet keep working. Keep the interpreters riscv64 can build in one place, RISCV64_PYTHONS in pending_versions.py, which check_versions.py's deprecation check now uses too. Update it when bumping cibuildwheel. Let riscv64_resolve.py accept any interpreter tag, not only the old default four. We may still want to exclude certain versions for a given package (for example, to omit an older wheel that won't build on riscv64), so allow passing flags to the script to indicate these versions. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Have _setup.yml always output a 'matrix' of {version, python} pairs,
built by pending_versions.py from each version's python-versions in
docs/packages/<pkg>.yaml. Workflows that still hard-code their
interpreters ignore it, so they can be converted gradually. Versions
missing python-versions are left out of the matrix and reported as
warning annotations rather than failing the setup job.
Add a 'python-exclude' input to drop interpreters for every version of
a package. It defaults to "cp39 cp310 cp311", following NumPy, which
only supports Python 3.12 and newer and which much of the registry
depends on.
Convert build-falcon.yml as a sample case, and run nightly.yml's PR
checks when pending_versions.py changes, since check_versions.py now
imports it.
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
…trix logic Provide better instructions based on the changes in ci_scripts/ and .github/workflows, to support dynamic Python matrix generation and situational excludes. Make sure that any automated rework to existing workflows is gradual, i.e. it occurs when a workflow is modified during meaningful work, instead of bulk editing all workflows now. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
d66bc45 to
34bd739
Compare
|
Gave a try to |
Instead of hard-coding our target versions, change our code in
ci_scripts/,.github/workflows,skills/, anddocs/development.mdto support dynamically deriving a target Python build matrix for each package, which can be rolled out gradually as updates are performed (instead of having to bulk rewrite and trigger all existing workflows). Now, when a workflow sets thepython-matrixparameter totrue, useci_scripts/pending_versions.pyto derive the list based on what the release targets upstream. Also allow us to extend/exclude the lists on a per-package basis by setting thepython-extendandpython-excludeinputs.Modify
build-falcon.ymlas a test change. The skills files indicate that the rollout should be gradual, so our existing automation can convert workflows over time as new releases are built.