This document records the exact steps to publish a new release of pythainer.
Prereqs:
- You have push access to the repo and the PyPI project.
CHANGELOG.mdfollows Keep a Changelog and Semantic Versioning.- Version in
pyproject.tomlis maintained manually (PEP 440). - CI is green on
main.
Versioning Tag format: v0.X.Y
Date format: YYYY-MM-DD.
-
Pick the version number
0.X.Y. -
Update
CHANGELOG.md:- Add a new section
## [0.X.Y] - YYYY-MM-DDunder[Unreleased]. - Move curated changes from
[Unreleased]into0.X.Y.
- Add a new section
-
Bump the version in
pyproject.toml:[project] version = "0.X.Y"
-
Sanity checks locally:
./scripts/all_checks.sh pytest -q git clean -ndx git status
-
Create a short-lived release branch and commit:
git checkout -b release git add -u git commit -s -m "Release 0.X.Y" git push -u origin release -
Open the corresponding PR on GitHub. When CI is green, merge.
After the PR is merged:
git checkout main
git pull --prune
git tag -a "v0.X.Y" -m "Release v0.X.Y"
git push origin v0.X.YUse a fresh clone and venv to avoid leaking deps:
git clone git@github.com:apaolillo/pythainer.git
cd pythainer/
python3 -m venv .venv-release
. .venv-release/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build twine
python3 -m build # creates dist/*.whl and dist/*.tar.gz
python3 -m twine check dist/*Quick inspection:
- Confirm wheel exists (preferably
py3-none-any.whlfor pure Python). - Confirm tarball contains only expected files.
# still in the .venv-release
python3 -m twine upload dist/*You will need a ~/.pypirc or to paste your __token__ API token when prompted.
-
PyPI page: https://pypi.org/project/pythainer/
-
Clean venv install:
python3 -m venv /tmp/venv-verify && . /tmp/venv-verify/bin/activate pip install -U pip pip install pythainer==0.X.Y pythainer --help deactivate
-
Check that README renders correctly on PyPI.
-
Profit.