Repository navigation
simplify build workflow and move cibuildwheel configuration to pyproject.toml - #1371
zacharyburnett wants to merge 9 commits into
Conversation
87babc2 to
b1f643b
Compare
b1f643b to
1843404
Compare
|
Why? What was wrong with the previous version? This is a pretty big overhaul with no (apparent to me) benefit. I'll let you make your case though.
This in particular seems purely wasteful. Why would we want to build wheels on every random PR? |
This reduces the amount of jobs actually running, and GitHub runners spun up, from 4 ( Additionally, moving the meaningful configuration to
I personally like to run a build job on every pull request so I know about build failures early, otherwise I'm blindsided by build failures when it comes to release time and have to scramble. I can take that out though if you prefer; there's always the |
This IMO is not particularly desirable. The reason for having 4 there was to reduce the human wait time for them all to finish building. |
24309a2 to
feeb083
Compare
feeb083 to
c790f48
Compare
84ef419 to
0a0a325
Compare
try ccache
0a0a325 to
4d2c51b
Compare
rmjarvis
left a comment
There was a problem hiding this comment.
I seem some benefits to the simplification here. But I have some significant concerns with the current implementation.
| cancel-in-progress: true | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| permissions: {} |
There was a problem hiding this comment.
What is the point of this? AFAIK, we only need permissions later when publishing. And specifying none here seems vaguely redundant.
There was a problem hiding this comment.
the default permissions given to GITHUB_TOKEN are very broad and have been misused in security breaches where someone added malicious code to an action. We can mitigate the amount of access given by setting permissions: {} globally and then adding permissions to individual jobs (see https://docs.zizmor.sh/audits/#excessive-permissions)
| with: | ||
| fetch-tags: true | ||
| fetch-depth: 0 | ||
| persist-credentials: false |
There was a problem hiding this comment.
Pretty sure these are unnecessary. And fetch-depth=0 is surely a waste of bandwidth.
There was a problem hiding this comment.
You're right, I usually work with projects that use setuptools_scm to retrieve the version from the Git tags in which case fetch-tags is necessary, and sometimes with projects that use release_branch_semver with release branches diverging from main, which needs fetch-depth: 0. But those are not needed here, I'll take them out
persist-credentials: false is recommended by zizmor to mitigate artifact packing that may exfiltrate credentials, either accidental or maliciously from upstream (see https://docs.zizmor.sh/audits/#remediation_2)
|
|
||
| permissions: | ||
| id-token: write | ||
| attestations: write |
There was a problem hiding this comment.
What is the point of attestations?
There was a problem hiding this comment.
https://docs.pypi.org/attestations/ attestations gives strong cryptographic proof that a binary was created by and signed by a specific source, in this case this github actions workflow. I don't think most users are actually checking attestations currently, but it's part of PyPI now so it doesn't hurt to have, especially if that ever changes. I can remove the attestation step if desired though
| - name: cache C++ build objects | ||
| uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24 | ||
| with: | ||
| key: ccache-${{ runner.os }}-${{ github.sha }} |
There was a problem hiding this comment.
I don't think this is doing anything useful. Including the sha here means the cache won't be reused I think. We only run this workflow once per commit, so I don't see the benefit of this.
Co-authored-by: Zach Burnett <zrb+git@hildebrind.space>
we can move these specific
cibuildwheelconfigurations intopyproject.toml, and it will run them for each platform / archalso,
cibuildwheelcan use emulation to build macOS Intel x86 wheels on the Apple Silicon platformalso also, we can run the
wheels.ymlworkflow on every pull request to build wheels (withon: pull_request) and use anifconditional to only attempt publishing to PyPI on an actual release