Follow Python Conventions
Apply the standard Tenzir Python toolchain and coding conventions.
Required Tools
All Tenzir Python projects use:
uvfor dependency management and virtual environmentsrufffor linting and formattingmypyfor static type checkingpytestfor testing
Default Libraries
Prefer these libraries unless the repository already establishes a different stack:
pydanticfor models and validationFastAPIfor REST APIsClickfor CLIs
Quality Gates
Run this sequence before committing or releasing:
uv run ruff check \
&& uv run ruff format --check \
&& uv run mypy \
&& uv run pytest \
&& uv build
Conventions
- Target Python 3.12 or later.
- Fully type all public surfaces.
- Avoid
Anyunless there is a concrete reason it cannot be removed. - Keep
__init__.pyfiles empty. - Use absolute imports from the package root.
- Use
snake_casefor modules, functions, and variables;PascalCasefor classes;CONSTANT_CASEfor constants. - Use kebab-case for CLI flags.
Reference Files
Load only the configuration reference you need: