A minimal, generic, and opinionated template for typed ✨ python projects that includes:
- make as a task runner
- uv for dependency management
- ruff for linting
- pyright for type checking
- pytest for testing
- pre-commit for running the above as hooks
- a GHA ci workflow that runs hooks every commit
Type hints are enforced. Uses a flat layout, ie: packages are defined at the top level. Naming conventions are as per PEP8, see Template parameters below. And not much else. This is meant to be generic, so anything specific to only a subset of projects probably lives elsewhere.
For more info see DESIGN.md.
Projects created using this template have development prerequisites.
The template will ask for the following:
repo_name
: The name of your repo. Repo names are lowered kebab-case, so hyphens rather than underscores, to be kind to humans.package_name
: The name of your main python package. A python package is a group of modules, ie: a directory with __init__.py file. Choose a short all-lowercase name without hyphens. The use of underscores is discouraged (see PEP8).project_name
: The name of the artifact when your project is built as a wheel. Project names are lowered kebab-case. In most cases the package name and project name will be the same. This is used in pyproject.toml and needed even if you aren't building a wheel.description
: a one line description of your project.
cruft is recommended for creating projects.
To create a project, aka bake a cookie 🍪, using uv and cruft:
uvx cruft git@github.com:tekumara/python-typed-template.git
# replace repo-name below with the name you specified during template creation
cd repo-name
git init && git commit -m 'root commit' --allow-empty
make install
Please do! See CONTRIBUTING.md