There must be a thousand of these around, including the one that is used in the cookiecutter turorial, so this is just one more.
- You are prompted just for 5 things.
- This contains boilerplate for:
- Testing your package using pytest
- Analysing test coverage of your package using coverage
- Documenting your package with Sphinx.
- Publishing documentation as a static website with Github Pages
- Publishing your package in PyPI when you push a tag to the
main
branch. - Using pre-commit hooks to ensure style alignment and code quality.
- Using tox to be sure that everything works fine in multiple Python versions (and compile documentation)
- Using make to make your life much simpler
- Checking that your package name is not currently in use in PyPI.
This can be used normally with cookiecutter just run:
$ cookiecutter gh:santibreo/cookiecutter-pypackage
To make the Github Workflow work you need to:
- Create an environment in your remote repo called 'release'.
- Configure a trusted publishing for your PyPI project.
If this is your first time best follow this tutorial (this workflow does not contain the signing part).
To publish the documentation to Github Pages you have to go to remote repo Settings > Pages and there select a branch and docs folder.