Poetry Cookiecutter
Cookiecutter for setting up poetry projects with all of the below features.
Features
- Packaging with poetry
- Formatting with black
- Linting with ruff
- Static typing with mypy
- Testing with pytest
- Git hooks that run all the above with pre-commit
- Continuous Integration with GitHub Actions
- Code coverage with Codecov
Setup
While all of the steps are automated, you will need to install poetry
.
Additionally, pipx
is recommended for installing any command line tools.
python3 -m pip install pipx
pipx ensurepath
# Install poetry and cookiecutter using pipx
pipx install poetry cookiecutter
# Use cookiecutter to create project from this template
pipx run cookiecutter gh:jevandezande/poetry-cookiecutter
The cookiecutter will automagically
- Generate a project with the input configuration
- Initialise git
- Install dependencies
- Setup pre-commit and pre-push hooks
- Make initial commit
Recommendations
Make a config file (see template_config.yml) with
default settings and save it as a .cookiecutterrc
or use it directly via:
--config-file cookiecutter.yml
Install act to run GitHub Actions locally.