Repository navigation
Description
Set up automated publishing of benchx to PyPI, using a tag-triggered workflow on this repository. The workflow is in #107, and #104 has already fixed the packaging it depends on. Conda packages are tracked separately in #108. Related: #76, on organization accounts for the distribution sites.
Updated after the discussion below: the first version of this plan also uploaded to anaconda.org. That's dropped, because it would need a long-lived token and PyPI's trusted publishing doesn't. Conda packages will come from a conda-forge feedstock instead, which follows the releases on PyPI. The original text is in this issue's edit history.
What #107 does
Pushing a v* tag runs these jobs, and only a tag publishes. PRs that touch the workflow, pyproject.toml or src/benchx/__init__.py run only the first one.
| Job | What it does | Access |
|---|---|---|
build |
Builds the sdist and wheel, checks the version matches the tag, runs twine check, and runs the tests from the installed wheel |
Read-only |
publish-pypi |
Uploads to PyPI with pypa/gh-action-pypi-publish |
pypi environment, using PyPI's trusted publishing |
github-release |
Creates the GitHub release and attaches the sdist and wheel | contents: write |
It also adds a release checklist in docs/releasing.md, reads the version from src/benchx/__init__.py so it's kept in one place, and renames the runner from benchx-prototype to benchx.
Setup before the first release
- PyPI: add a pending publisher on the
benchxorg: projectbenchx, ownerbenchx-dev, repositorybenchx, workflowrelease.yml, environmentpypi. This doesn't reserve the name. - GitHub: create the
pypienvironment with required reviewers, administrator bypass off and self-review prevention on. - GitHub: change the environment's
v*rule to a tag rule. It's currently a branch rule, which should make GitHub reject the publish job on a tag. Do this before pushing any tag. - GitHub: settle the environment's required reviewers (see the open questions below).
Release sequence
- Merge MAINT: switch to the
src/layout #104. - Merge CI: publish releases to PyPI #107.
- Set the version to
0.1.0rc1, push tagv0.1.0rc1, and have a second reviewer approve the publish job. - Test the install on a clean machine with
pip install --pre benchx. - Set the version to
0.1.0, push tagv0.1.0, and have a second reviewer approve the publish job. - Set the version to
0.2.0.dev0, so that results frommaindon't claim to come from the release.
Once 0.1.0 is on PyPI, #108 can start. docs/releasing.md in #107 has the full checklist for later releases.
A real release candidate is proposed instead of TestPyPI because it tests the actual publishing setup and also claims the name. It stays on PyPI permanently, but pip skips pre-releases by default.
The approval, PyPI trusted publishing and creating the GitHub release can't run from a pull request, so they first run with the release candidate. A problem there would need a follow-up fix and a new release candidate.
Open questions from the first version
- Approvals: one approval from a listed reviewer is enough, once per release. Self-review prevention is on, so that reviewer can't be whoever pushed the tag, and a release takes two people.
- Who can publish: still to settle. The
pypienvironment lists six required reviewers, while the discussion below suggested the three people in the PyPI org. Restricting who can createv*tags is optional on top of that, because GitHub rulesets can't exempt individual users, so it would need a team. - conda: decided: conda-forge, not the
BenchXchannel on anaconda.org. See Distribute benchx through conda-forge #108. - Separate release repository: not planned for now. NumPy and SciPy use one to limit who has write access, which seems like more than this project needs today.
Activity
ev-br commentedon Nov 6, 2026
LGTM overall!
A couple of small comments:
For open questions:
numpy-releaserepository: the main repo does not have anything release related, andnumpy-releasehas way less people with write access. Don't know if it's an overkill here.[-]Automate releases to PyPI and anaconda.org[/-][+]Automate releases to PyPI[/+][-]Automate releases to PyPI[/-][+]Automate releases to PyPI and conda-forge[/+][-]Automate releases to PyPI and conda-forge[/-][+]Automate releases to PyPI[/+]rok commentedon Nov 6, 2026
I think this is done, conda-forge is a separate issue.