- Create release branch
X.Y.Zfromdevelop. - Update
VERSIONincastle/version.pyto the new version. - Update
CHANGELOG.rstfor the impending release. git commit -am "release X.Y.Z"(whereX.Y.Zis the new version).- Push to GitHub, open a PR to
develop, and merge when approved. - On
develop: runmake testandmake lint(or confirm CI is green). - Pull latest
develop, merge intomaster, and push ``master`` to ``origin``. - Create a GitHub release from
masterwith tagvX.Y.Z(see below). - Publish to PyPI from
master(see below). A GitHub release does not publish the package; PyPI is updated only viatwine upload.
Create the release only after master on origin contains the release commit.
gh release create vX.Y.Z \
--title "Release X.Y.Z" \
--notes-file release-notes.mdUse --latest as a separate flag if you need to mark the release as Latest; do not put --latest in --title.
From a clean checkout of master at the release commit:
git checkout master && git pull
rm -rf dist build
pip install build twine
python3 -m build
twine check dist/*
twine upload dist/*When you change README.rst, validate that PyPI will accept it:
python3 -m build && twine check dist/*PyPI ignores README.rst if it is not valid reStructuredText.
twine upload --repository-url https://test.pypi.org/legacy/ dist/*