Plug-and-play cookiecutter template for creating a new Python library (or simply a tested, documented and deployable package), written with easy-of-use and customizability in mind.
All you got to do is clicking on the "Use this template" green button and you will end up with a complete Python package named after your project.
There are plenty of cookiecutter templates out there, but all of them require configuring your package by hand, installing cookiecutter, the dependencies, generating the project, following the prompt and so on.
This template attempts to address "the problem", aiming at providing a plug-and-play solution for lazy people like me.
-
testing setup with
pytest
-
Github workflows for continuous integration testing
-
Sphinx docs ready for generation, further simplified through a Makefile
-
Auto-release to PyPI when you push a new tag to master, with dynamic update of the version/tag number (no need to update any file!)
-
some common style-guidelines already setup for usage
To use this action, you need to create a PyPI account and an API token against that account.
Once you did, add that token to your repository as a GitHub secret called PYPI_TOKEN
(don't change this name!).
under Settings > Secrets > New Secret
and you're done.
From now on, any time you create a new Release or push a new tag on GitHub, the action will trigger, building your package and pushing it to PyPI.
The version number is gonna be updated automatically and only depends on the numbering of your release/tag.
Run
make apidoc
to produce the rst
files and
make doc
to produce the documentation.
The setup.yml
workflow is adapted (mostly borrowed) from this repository, but the template itself belongs to me.