python3.9 -m venv venv
source venv/bin/activate
python -m pip install -U pip
python -m pip install build
python -m build --wheel --outdir dist
deactivate
source venv/bin/activate
python -m pip install twine
And then follow the steps described in this document.