The following procedures gives a short overview of what steps are needed to create a new release.
-
Verify:
-
all issues for a new release are closed: https://github.com/python-semver/python-semver/issues.
-
that all pull requests that should be included in this release are merged: https://github.com/python-semver/python-semver/pulls.
-
that continuous integration for latest build was passing: https://github.com/python-semver/python-semver/actions.
-
-
Create a new branch
release/<VERSION>
. -
If one or several supported Python versions have been removed or added, verify that the 3 following files have been updated:
setup.cfg
tox.ini
.git/workflows/pythonpackage.yml
CITATION.cff
-
Verify that the version has been updated and follow https://semver.org:
src/semver/__about__.py
docs/usage/semver-version.rst
-
Add eventually new contributor(s) to CONTRIBUTORS.
-
Check if all changelog entries are created. If some are missing, create them.
-
Show the new draft CHANGELOG entry for the latest release with:
$ tox -e changelog
Check the output. If you are not happy, update the files in the
changelog.d/
directory. If everything is okay, build the newCHANGELOG
with:$ tox -e changelog -- build
-
Build the documentation and check the output:
$ tox -e docs
-
Commit all changes, push, and create a pull request.
-
Ensure that long description (README.rst) can be correctly rendered by Pypi using
restview --long-description
-
Clean up your local Git repository. Be careful, as it will remove all files which are not versioned by Git:
$ git clean -xfd
Before you create your distribution files, clean the directory too:
$ rm dist/*
-
Create the distribution files (wheel and source):
$ tox -e prepare-dist
-
Upload the wheel and source to TestPyPI first:
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
If you have a
~/.pypirc
with atestpypi
section, the upload can be simplified:$ twine upload --repository testpypi dist/*
-
Check if everything is okay with the wheel. Check also the web site
https://test.pypi.org/project/<VERSION>/
-
If everything looks fine, merge the pull request.
-
Upload to PyPI:
$ git clean -xfd $ tox -e prepare-dist $ twine upload dist/*
-
Go to https://pypi.org/project/semver/ to verify that new version is online and the page is rendered correctly.
-
Create a tag:
$ git tag -a x.y.z
It's recommended to use the generated Tox output from the Changelog.
-
Push the tag:
$ git push origin x.y.z
-
In GitHub Release page document the new release. Select the tag from the last step and copy the content of the tag description into the release description.
-
Announce it in https://github.com/python-semver/python-semver/discussions/categories/announcements.
You're done! Celebrate!