Repository navigation
chore: make the project releasable - #130
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The publishing setup could not produce a release, in three independent ways:
test_pypi.ymltriggered only on push/PR to a branch calleddocumentation— never on tags.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.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.0sat in the source tree for eighteen months and was never published. PyPI still has only0.1, from 2024-05-26.What changed
release.ymlreplacestest_pypi.ymlworkflow_dispatchrun rehearses the same build against TestPyPI first.pypi/testpypienvironments — no long-lived token to store or rotate.twine check, is scanned by theno-medical-imagesguard, and refuses to publish when the release tag disagrees withpyproject.toml.Version and metadata
requires-pythonraised 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.Changelog
docs/source/changelog.rstwas a 21-byte stub, so the published site shipped an empty Changelog page. It now includesCHANGES.mdvia myst-parser.CHANGES.mdgains a0.3.0entry covering the ~350 commits since 0.1, grouped by theme, flagging the two breaking changes (Python floor,Radiomicsnow requiringoutput_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
Version 0.3.0,Requires-Python >=3.10, 13 classifierstwine checkpasses on both artefacts0.3.0andv0.3.0, rejects0.2.0andv1.0.0pre-commit run --all-filespassesNot 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, repositoryPyTheranostics, workflowrelease.yml, environmentpypi(testpypi) — and create the matching environments under repository Settings. I cannot do either.Judgement calls worth your review
Removedline mentions example data and hardcoded study paths in neutral terms. If you want that framed differently in public release notes, say so.