Skip to content

Conversation

@mhucka
Copy link
Contributor

@mhucka mhucka commented Nov 2, 2025

Changes:

  • Move more cibuildwheel settings into the pyproject.toml file, which both aligns with recommended practices and allows simplifications to ci.yml.

  • Get rid of preflight_check_dists job in ci.yml and make the twine check step be part of the upload_to_testpypi job. This simplifies and streamlines the workflow.

  • Get rid of references to vars.ACT in ci.yml, which turn out to be unnecessary.

  • Enhance local testability by adding support for using a local pypi server for testing in the upload_to_testpypi job.

  • Add an input variable upload_to_pypi to workflow_dispatch invocations to allow control over whether the upload to pypi.org is done during manual invocations.

  • Set skip-existing to true when using actions/gh-action-pypi-publish so that partial reruns of the workflow are possible.

  • Use explicit versions of runners instead of -latest.

  • Make miscellaneous small tweaks to ci.yml.

  • Add a README file to .github/workflows/ detailing how to do local testing of ci.yml, to document the process.

mhucka added 14 commits November 2, 2025 04:50
Changes:

- Remove the needless `preflight_check_dists` job
- Merge the wheel testing step into upload_to_testpypi
- Add the use of `check-wheel-contents` to the tests
- Make various changes to better support local testing
- Simplify some of the workflow syntax used
Update and add more details about the testing process.
If an error is reported, it's easier if it's obvious which of the two
programs produced it.
This will make the command show up in the run log as its own entry,
making it easier to locate in the output.
Some of the settings for building wheels can be put into
`pyproject.toml`. This fits with current best practices and lets us
further simplify `ci.yml`.
Turns out `vars.local_testing` is never needed.
`check-wheel-contents` complains about the wheel only on Windows and not
other architectures. I suspect there is a bug in `check-wheel-contents`.
Better to skip it for now.
@mhucka mhucka changed the title Improve ci.yml and enhance testability Improve ci.yml, enhance testability, and document the testing process Nov 2, 2025
@mhucka mhucka marked this pull request as ready for review November 2, 2025 20:20
@mhucka mhucka added the devops Involves build systems, CMake files, Make files, Bazel files, continuous integration, and/or related label Nov 2, 2025
I can't think of a good reason to cause the job to fail if an existing
file from the same release is already on pypi. This might happen if you
try to rerun the workflow because of a failure during one of the files.
Let's just let it give a warning and move on.
I realized that the values should be left unset in the default case.

```dockerfile
# Start from a base image that is already configured for act.
FROM catthehacker/ubuntu:act-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catthehacker?

Should this be pinned?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know, catthehacker sounds dodgy :-). It's the moniker of the user who builds Docker images for use with act: https://nektosact.com/usage/runners.html

Good point about pinning that with a hash. I will also see if I can find an alternative, because if nothing else, this invites suspicion.


```shell
rm -rf /tmp/act-artifacts/*
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like quite a lot of instructions for "run ci locally". They also look like instructions that will become out of date in a year or two due to some detail changing (like mentioning specific github usernames and python packages and cache locations).

Basically I have low confidence that if I read this in a year that it will work, which is perhaps unavoidable, but maybe an alternate strategy like linking to a "how to run github ci" documentation page within github is possible? Ironically my instinct is to take a complex step like this and ensure the process specified in the documentation is tested in ci so if something becomes wrong it flags immediately.

Copy link
Contributor Author

@mhucka mhucka Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linking to a "how to run github ci" documentation page within github

I wish there was! But so far I haven't found anything that makes all these details explicit. People can work it out, but because it took some effort for me to figure it out, it made sense to write it down (otherwise I'll forget how it was done). And once I started writing notes, it wasn't much more work to include a readme here.

It's true it's a lot of instructions. Not all are really necessary for Chromobius; for example, contributors don't really need to test uploading wheels to a PyPI index for a normal local run. Overall, maybe it would make more sense to put this information elsewhere. What about:

  • the wiki on GitHub?
  • a Google doc?

W.r.t. having tests for this, that's a great idea, but maybe that can be left for future work?

{os: ubuntu-latest, dist: cp312-manylinux_x86_64, arch: x86_64},
{os: ubuntu-latest, dist: cp313-manylinux_x86_64, arch: x86_64},
{os: ubuntu-latest, dist: cp314-manylinux_x86_64, arch: x86_64},
{os: ubuntu-24.04, dist: cp310-manylinux_x86_64, arch: x86_64},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this changed to latest last commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These workflows are a bit frustrating. On one hand, it's good to test against the latest runners in order to catch breakage when something changes; OTOH, it's better for reproducibility to use a specific version. Most sources (including Google's) recommend using specific versions, so I thought it better to go back to doing that. (Do you prefer using -latest instead?)

In principle, that variable shouldn't need to be set. Let's try removing it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops Involves build systems, CMake files, Make files, Bazel files, continuous integration, and/or related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants