Releasing (maintainers)¶
Releases are published to PyPI by the GitHub workflow .github/workflows/publish.yml with trusted publishing: PyPI trusts the workflow of this repository, no password or API token is stored.
One-time setup¶
PyPI: log in at https://pypi.org (two-factor authentication is required), open Your account → Publishing and add a pending publisher:
Field
Value
PyPI project name
eval-acOwner
WillyWallaceRepository name
eval_acWorkflow name
publish.ymlEnvironment name
pypiTestPyPI: the same at https://test.pypi.org (separate account) with the environment name
testpypi.GitHub: Settings → Environments → create the environments
pypiandtestpypi. Forpypi, Required reviewers (yourself) is recommended: every upload to PyPI then has to be confirmed in the Actions tab.
Test upload to TestPyPI¶
Actions → Publish → Run workflow builds the package and uploads it to TestPyPI. Check the result:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ eval-ac
eval-ac --version
Each version can be uploaded to TestPyPI (and to PyPI) only once. For a second test upload, increase the version, e.g. 0.3.1.dev1.
Release¶
Set the version in
eval_ac/__init__.py(e.g.__version__ = "0.4.0").In
CHANGELOG.md, rename Unreleased to the version and date.Merge into
main.On GitHub: Releases → Draft a new release, tag
v+ version (e.g.v0.4.0) onmain, paste the changelog section as description, Publish release.
The workflow checks that the tag matches the package version, builds sdist and wheel, checks them with twine check and uploads them to PyPI. Read the Docs builds the documentation of the tag automatically.
Versions follow semantic versioning: until 1.0 the interface may still change between minor versions.