Spinning up new Python projects with cookiecutter
Batteries are, in fact, not included in a modern Python environment. The missing components include:
- Package / project manager: uv
- Test runner: pytest
- Type checker: mypy
- Auto-documentation: mkdocs
- Auto-formatter: ruff
- Dependency validation: deptry
- LSP server: pyright
Enter cookiecutter, a tool for creating new projects from a template. A python project specific cookiecutter template allows me to quickly spin up a new project with these components included. To bring in my defaults and idiosyncrasies (e.g. emacs LSP configuration), I forked cookiecutter-uv
. To use it the first time call:
cookiecutter https://github.com/jtmoulia/cookiecutter-qpy.git
This will fetch the template into ~/.cookiecutters
and interactively prompt for the project description. With cookiecutter-qpy
cached locally, future invocations only require:
cookiecutter cookiecutter-qpy