A simple template for a cli to publish python libraries in a safe and consitent way to pypi.
It runs tests and ensure a clean repo before publish and handles the git tagging of the release in a sane way.
- git
- python
- twine
- pytest
- Copy
publish.shto the project root - Replace
<package-name>with the name of the library.
To publish version 0.13.37
- Run
./publish.sh 0.13.37 - Follow instructions
- The script will only push the git tags if the tests pass
- The script will try its best to clean up the git state after itselves when it fails, but this is not a guarantee, double check with
git statuswhen recovering after a failure.