Repository navigation
Support dynamic Python build matrices #3541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
27a764d
752d67f
c58a458
6fad0cb
4e76952
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,17 +15,33 @@ on: | |
| required: false | ||
| default: '' | ||
| type: string | ||
| python-matrix: | ||
| description: Also compute the matrix output from the python-versions of each version in docs/packages/<package>.yaml. | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| python-exclude: | ||
| description: Space-separated interpreter tag globs (e.g. "cp39 cp315*") never to build. | ||
| required: false | ||
| default: '' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still want to follow numpy, or should we let the dynamic matrix follow each project from now on, excluding versions only when they don't build for riscv64 (or for another related reason)? |
||
| type: string | ||
| outputs: | ||
| versions: | ||
| description: JSON list of versions to build; "[]" when there is nothing to build. | ||
| value: ${{ jobs.setup.outputs.versions }} | ||
| matrix: | ||
| description: >- | ||
| JSON matrix include list of {version, python} pairs (python being a | ||
| cibuildwheel tag like cp314t); "[]" unless python-matrix is set. | ||
| value: ${{ jobs.setup.outputs.matrix }} | ||
|
|
||
| jobs: | ||
| setup: | ||
| if: github.event_name != 'pull_request' || github.actor != 'dependabot[bot]' | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| versions: ${{ steps.versions.outputs.versions }} | ||
| matrix: ${{ steps.versions.outputs.matrix || '[]' }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
|
|
@@ -43,7 +59,16 @@ jobs: | |
| env: | ||
| PACKAGE: ${{ inputs.package }} | ||
| VERSION_GLOB: ${{ inputs.version }} | ||
| PYTHON_MATRIX: ${{ inputs.python-matrix }} | ||
| PYTHON_EXCLUDE: ${{ inputs.python-exclude }} | ||
| run: | | ||
| versions=$(uv run --quiet ci_scripts/pending_versions.py ${VERSION_GLOB:+--glob "$VERSION_GLOB"} "$PACKAGE") | ||
| echo "versions=$versions" >> "$GITHUB_OUTPUT" | ||
| echo "Versions to build: $versions" | ||
| if [ "$PYTHON_MATRIX" = "true" ] && [ "$versions" != "[]" ]; then | ||
| matrix=$(uv run --quiet ci_scripts/pending_versions.py --python-matrix \ | ||
| --python-exclude "$PYTHON_EXCLUDE" \ | ||
| ${VERSION_GLOB:+--glob "$VERSION_GLOB"} "$PACKAGE") | ||
| echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
| echo "Matrix: $matrix" | ||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why false by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.