Releasing
Releases go to PyPI through GitHub Actions with Trusted Publishing: PyPI trusts this repository's workflow, so no API token is created or stored.
One-time setup (a maintainer, on pypi.org and test.pypi.org)
- Create the PyPI project name
reportnet-api(the first upload does this) and enable two-factor authentication on the account. - On PyPI, open Your projects → reportnet-api → Publishing (for a project that does not
exist yet, Account settings → Publishing → Add a pending publisher) and add a
GitHub publisher with: owner
eeadata, repositoryreportnet-api-python, workflowrelease.yml, environmentpypi. - Repeat on test.pypi.org with environment
testpypi. - In the GitHub repository settings, create the two environments
pypiandtestpypi(forpypiyou can require a reviewer's approval). - Add a second owner or maintainer to the PyPI project, so it never depends on one person.
- Docs site: Settings → Pages → Source: GitHub Actions (done). The Docs workflow
publishes to https://eeadata.github.io/reportnet-api-python/ when
docs/**ormkdocs.ymlchange onmain, or when run by hand. - Actions are pinned to exact commits; Dependabot (
.github/dependabot.yml) proposes updates monthly.
Each release
- Update
versioninpyproject.tomland the entry inCHANGELOG.md. uv run ruff check . && uv run mypy reportnet_api && uv run pytestmust pass (CI runs them on Python 3.11 to 3.14).- Rehearse: run the Release workflow by hand (Actions tab → Release → Run workflow).
It uploads to TestPyPI. Install from there in a clean environment and import it:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ reportnet-api. - Release: create a GitHub release whose tag is
v<version>(for examplev0.1.0). The workflow refuses to publish if the tag andpyproject.tomldisagree. - Update the README's install line when the first release is out.
- Keep the README's images as absolute
https://raw.githubusercontent.com/eeadata/reportnet-api-python/main/...links: PyPI cannot resolve relative image paths.
A version number on PyPI can never be reused, even after deleting it, so always rehearse first.