These are the steps I take when releasing a version of my Python package to PyPI.

Run some checks/cleaning. If any fail, start again. I recommend puttting these into pre-commit hooks.

pylint --disable=all --enable=unused-import **/*.py
mypy --disallow-untyped-defs --strict-optional package
isort -rc package
black **/*.py

Run tests.

rm -r .tox
tox  # Continue below while this is running

Update version in
Update supported Python versions in
Update documentation.


git commit
git push
git tag (version)
git push --tags

Create the sdist and upload it:

pip install -U pip setuptools twine
python sdist
twine check dist/*
twine upload dist/*

Update coverage badge:

pytest --cov-report term-missing --cov package tests  # requires pytest-cov
coveralls  # requires coveralls and pyyaml installed

Build readthedocs if there’s been changes.
Update related blog posts.