A minimal boilerplate for starting new Python projects with a consistent development setup.
Included by default:
- Python 3.14+
uvfor dependency and environment managementrufffor linting and formattingmypyfor static type checkingpytestfor testingpre-commitfor automated checks- GitHub Actions CI
.envsupportsrc/project layout
Make sure the following are installed:
- Python 3.14+
- uv
Create a new repository from this template, then clone it locally.
Install the project dependencies:
uv syncInstall the pre-commit hooks:
uv run pre-commit installCreate your local environment file:
cp .env.example .envThe .env file is ignored by Git and should be used for local secrets and configuration.
Before starting development, update the project-specific values in pyproject.toml.
Update:
[project]
name = "project-name"
version = "0.1.0"
description = "Short project description"The default package lives under:
src/project_name/
Rename project_name to match your project.
Remember to update any references to project_name in:
pyproject.tomltests/- CI or tooling configuration, if applicable
The template exposes an application command through:
[project.scripts]
app = "project_name.main:main"After renaming the package, update it accordingly:
[project.scripts]
app = "awesome_app.main:main"This maps:
uv run appto the main() function inside:
src/awesome_app/main.py
The recommended way to run the project is:
uv run appYou can also run the module directly:
uv run python -m project_name.mainReplace project_name with your actual package name.
uv run pytestuv run ruff check .Automatically fix supported lint issues:
uv run ruff check . --fixuv run ruff format .uv run mypy src testsuv run pre-commit run --all-filesPre-commit hooks also run automatically when committing after:
uv run pre-commit installAdd a runtime dependency:
uv add <package>Add a development dependency:
uv add --dev <package>uv automatically updates both pyproject.toml and uv.lock.
Put local environment variables in:
.env
This template uses the MIT License.
Update the copyright information in LICENSE
before publishing a new project.