Skip to content

chore: make the project releasable - #130

Merged
carluri merged 1 commit into
mainfrom
chore/release-plumbing
Nov 14, 2026
Merged

carluri merged 1 commit into
mainfrom
chore/release-plumbing

Conversation

@carluri

@carluri carluri commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Why

The publishing setup could not produce a release, in three independent ways:

  1. test_pypi.yml triggered only on push/PR to a branch called documentation — never on tags.
  2. Its upload step was gated on if: startsWith(github.ref, 'refs/tags'). Since the workflow never ran on a tag ref, that condition could never be true. Pushing a tag published nothing.
  3. It authenticated with secrets.PYPI_API_TOKEN, and the repository has no secrets at all (total_count=0, repo and org). The token did not exist.

Consequently 0.2.0 sat in the source tree for eighteen months and was never published. PyPI still has only 0.1, from 2024-05-26.

What changed

release.yml replaces test_pypi.yml

  • Publishing runs when a GitHub Release is published, so the release notes and the uploaded artefacts always describe the same thing. Pushing a bare tag no longer does anything.
  • A workflow_dispatch run rehearses the same build against TestPyPI first.
  • Authentication is PyPI Trusted Publishing (OIDC) through pypi / testpypi environments — no long-lived token to store or rotate.
  • The build runs twine check, is scanned by the no-medical-images guard, and refuses to publish when the release tag disagrees with pyproject.toml.

Version and metadata

  • Version set to 0.3.0. 0.2.0 is skipped deliberately: it was never published, and reusing it would leave the PyPI history ambiguous.
  • requires-python raised to >=3.10, matching what CI actually tests. The declared 3.8 was never tested and is end of life. The two documentation places still claiming 3.8 are updated.
  • Added the missing Python-version, audience, topic and development-status classifiers (3 → 13).

Changelog

  • docs/source/changelog.rst was a 21-byte stub, so the published site shipped an empty Changelog page. It now includes CHANGES.md via myst-parser.
  • CHANGES.md gains a 0.3.0 entry covering the ~350 commits since 0.1, grouped by theme, flagging the two breaking changes (Python floor, Radiomics now requiring output_dir).

CONTRIBUTING.md gains a Releasing section — the one-time trusted-publisher setup and the step-by-step release procedure. It was previously silent on releasing.

Verified locally

  • wheel + sdist build; report Version 0.3.0, Requires-Python >=3.10, 13 classifiers
  • twine check passes on both artefacts
  • neither artefact contains medical image data
  • tag guard accepts 0.3.0 and v0.3.0, rejects 0.2.0 and v1.0.0
  • changelog page renders both releases (24,580 bytes, was an empty stub)
  • docs build with no new warnings
  • full pre-commit run --all-files passes

Not verified, and needs action before the first release

The publish path itself cannot run until you create, on PyPI (and TestPyPI if you want rehearsals), a trusted publisher for owner qurit, repository PyTheranostics, workflow release.yml, environment pypi (testpypi) — and create the matching environments under repository Settings. I cannot do either.

Judgement calls worth your review

  • 0.3.0 vs 0.2.0 — my reasoning is above, but it is your call.
  • The changelog entry summarises 350 commits thematically rather than exhaustively. It is grounded in the commit log, but it is a summary and deserves a maintainer's eye before it ships as release notes.
  • The Removed line mentions example data and hardcoded study paths in neutral terms. If you want that framed differently in public release notes, say so.

The publishing setup could not produce a release. `test_pypi.yml` ran only
on pushes to the `documentation` branch, and its upload step was gated on
`startsWith(github.ref, 'refs/tags')` — a condition that could never be
true, because the workflow never ran on a tag. The repository also holds
no secrets at all, so the `PYPI_API_TOKEN` it referenced did not exist.
The result is that 0.2.0 was carried in the source tree for eighteen
months and never published; PyPI still has only 0.1 from May 2024.

Replace it with `release.yml`:

- Publishing is driven by publishing a GitHub Release, so the release
  notes and the uploaded artefacts always describe the same thing.
- A manual run can rehearse the whole path against TestPyPI first.
- Authentication uses PyPI Trusted Publishing (OIDC) through the `pypi`
  and `testpypi` environments, so no long-lived token is stored. Each
  index needs a one-time trusted-publisher entry; CONTRIBUTING.md says
  how.
- The build is checked with `twine check`, scanned by the medical-image
  guard, and refuses to publish when the release tag disagrees with the
  version in pyproject.toml.

Alongside it:

- Set the version to 0.3.0. 0.2.0 is skipped because it was never
  published, and reusing it would make the PyPI history ambiguous.
- Raise `requires-python` to >=3.10, matching the versions CI actually
  tests. The declared 3.8 was never tested and is end of life. Update the
  two places in the documentation that still claimed 3.8.
- Add the Python version, audience, topic and development status
  classifiers the package was missing.
- Publish the changelog: `docs/source/changelog.rst` was a 21-byte stub,
  so the documentation shipped an empty Changelog page. It now includes
  CHANGES.md through myst-parser, and CHANGES.md gains a 0.3.0 entry
  covering the roughly 350 commits since 0.1, grouped by theme.
- Document the release process in CONTRIBUTING.md, which was silent on it.

Verified locally: the wheel and sdist build and report version 0.3.0,
Requires-Python >=3.10 and 13 classifiers; `twine check` passes on both;
neither artefact contains medical image data; the tag guard accepts
`0.3.0` and `v0.3.0` and rejects mismatches; the changelog page now
renders both releases; the docs build with no new warnings; and the full
pre-commit suite passes.

Not verified: the publish path itself, which cannot run until the
trusted-publisher entries and the two environments exist.
@carluri
carluri merged commit 77bca8b into main Nov 14, 2026
6 checks passed
@carluri
carluri deleted the chore/release-plumbing branch November 14, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant