Modern cookiecutter template for python cli apps with,
- 🖥️ Typer as main cli libarary.
- 📦 Poetry for dependancy management.
- 🤖 Pre-commit with Ruff for code formatting and MyPy as type checker.
- 🦺 Pytest for unit testing.
- 🐋 Docker setup.
- Python 3.10 or greater.
- Pipx (install instructions).
- Intall
cookiecutterusingpipx install cookiecutter. - Install
poetryusingpipx install poetry. - Run
cookiecutter https://github.com/chamoda/cookiecutter-typer.gitto create a new project from template.
After template created following steps gets you ups and running with the working cli app.
- Create git repo inside the template with
git init && git add . && git commit -m "Init" - Create a virtual enviroment with
python3 -m venv venvand active it usingsource venv/bin/activate - Go to newly create project directory and run
poetry install - Run
pre-commit installto install git hooks. - Run
cli-templateor equalant name you used forapp-slugto run cli. - Run tests with
pytest
- Clone this project
- Run
cookiecutter PATH_TO_PROJECT --replay --overwrite-if-existsrerun changes to project back into created template for testing.