Create, activate, deactivate a virtual environment:
python -m venv venv
.\venv\Scripts\activate # windows
source venv/bin/activate # linux
deactivateInstall dependencies:
pip install -r requirements.txtTo update requirements.txt, use https://azurda.github.io/
python -m unittest -vruff formatTo test whether the library works on different versions of Python, use pyenv.
-
Format the code:
ruff format -
Update the version number in
setup.pyusing semantic versioning. -
Run the unit tests and check whether all tests pass:
python -m unittest -
Commit and push the changes to GitHub.
-
Add a version tag:
git tag v1.2.3 git push --tag -
Clear the
distfolder -
Build the library:
python -m build -
Publish on PyPI:
twine check dist/* twine upload dist/*