Intro
This is an implementation following the pattern of https://github.com/scipy/scipy-release of building release builds outside of the main repo.
Currently it lives at https://github.com/ksunden/matplotlib-release
I am in particular looking for technical review from @QuLogic, and policy review from the steering council (@tacaswell @efiring @dopplershift @timhoffm).
Catalyzing incident (failure to upload v3.10.8)
The build failed, not because of anything actually wrong with matplotlib, but because
one of the dependencies (Pillow) lacked a wheel and the headers to build from source were missing.
The failure was in the test stage, not the wheel building stage.
Rather than fix in repo and tag as 3.10.9, skipping yet another version in this series,
I decided to accelerate the timeline for building in an external repo.
Technical details
Usage
Branches mirror the main repo with main and v3.XX.x branches
Target is set by editing the SOURCE_REF_TO_BUILD: main at the top of the workflow file.
For releases, this should point to the tag
Release builds are done via dispatch_workflow with the pypi option chosen. (Most often web UI, also available vi CLI etc)
Changes from existing workflows
-
License file munging
- In doing a review, noticed that our auxilliary licenses are not being included and have not been since 3.9.0
- Meson-python version that we use does not handle multiple license files
- May look into newer versions, we were pinned for unrelated reasons, worth investigating
- Auxilliary licenses combined into one file, which lives in the matplotlib-release repo
- That file is cat'd onto the main LICENSE file, which is then included in wheel .dist-info
- Happens as a separate job that uploads the artifact for auditability
- Interstitial sdist uploaded with a name that is not caught by publish artifact downloader
-
Trigger conditions:
- since this repo is separate, I do just trigger on push/pull request, but final uploads must be done with
workflow_dispatch (which is new)
-
CIBW_AFTER_BUILD does not actually exist, so those steps were not run previously
- Moved some into
CIBW_TEST_COMMAND, but in the process of getting things to work mostly elided
- Twine check removed because python 3.13t proved hard due to
cryptography trying to install there (CFFI under the hood the problem)
- License check removed due to combining into one file
-
CIBW_TEST_ENVIRONMENT added PIP_PREFER_BINARY=1
- This is the actual fix for why 3.10.8 failed
- Used the general solution to avoid similar problems in the future
-
Upload tasks
- Largely taken from scipy's version, with only minor edits (mostly s/scipy/matplotlib/g)
- Include testpypi upload option
- Include check that upstream reference is a tag
- I did not change this other than the repo it points to, seems potentially underspecified but didn't look too hard at it
- Attestations now baked into the pypa/gh-action-pypi-publish, so removed that extra step
- id-token only permission necessary it seems
- I have not fully tested these, as fully doing so requires uploading to PyPI, sooo
Followup steps
Near term/get 3.10.8 out
Future work
Intro
This is an implementation following the pattern of https://github.com/scipy/scipy-release of building release builds outside of the main repo.
Currently it lives at https://github.com/ksunden/matplotlib-release
I am in particular looking for technical review from @QuLogic, and policy review from the steering council (@tacaswell @efiring @dopplershift @timhoffm).
Catalyzing incident (failure to upload v3.10.8)
The build failed, not because of anything actually wrong with matplotlib, but because
one of the dependencies (Pillow) lacked a wheel and the headers to build from source were missing.
The failure was in the
teststage, not the wheel building stage.Rather than fix in repo and tag as 3.10.9, skipping yet another version in this series,
I decided to accelerate the timeline for building in an external repo.
Technical details
Usage
Branches mirror the main repo with
mainandv3.XX.xbranchesTarget is set by editing the
SOURCE_REF_TO_BUILD: mainat the top of the workflow file.For releases, this should point to the tag
Release builds are done via
dispatch_workflowwith thepypioption chosen. (Most often web UI, also available vi CLI etc)Changes from existing workflows
License file munging
Trigger conditions:
workflow_dispatch(which is new)CIBW_AFTER_BUILDdoes not actually exist, so those steps were not run previouslyCIBW_TEST_COMMAND, but in the process of getting things to work mostly elidedcryptographytrying to install there (CFFI under the hood the problem)CIBW_TEST_ENVIRONMENTaddedPIP_PREFER_BINARY=1Upload tasks
Followup steps
Near term/get 3.10.8 out
Future work
license-files(we specify in meson.build, but don't think they get used)