These are my defaults for a new project. Each one links to the page that explains it.
- Toolchain:
uvfor dependencies, interpreters, tools, scripts and builds. - Project: all configuration in
pyproject.toml, development tools in[dependency-groups], asrc/layout, and the lockfile committed. - Linting and formatting:
rufffor both. - Type checking:
tyfor type checker and language server. - Data models: Pydantic,
dataclassesorattrs, andpydantic-settingsfor configuration. - Errors: one base exception per package, with third-party exceptions wrapped where they enter, using
raise ... from. - Logging: Loguru or structlog, configured once at the application entry point and never inside a library.
- Testing:
Hypothesis or pytestwith fixtures and parametrization. - CLIs: Typer or Cyclopts.
- Documentation: Sphinx or MkDocs with Material and mkdocstrings.
- CI:
uv sync --lockedfirst, actions pinned to commit SHAs, and a read-only token. - Publishing: trusted publishing to PyPI.