Skip to Content

What goes into pyproject.toml for a Python AI project?

Category: DevOps & Deployment

Answer

black (line length, target-version), isort (profile=black), mypy (strict, ignore_missing_imports for libraries), pytest (asyncio mode, markers for slow/integration), coverage (source, omit). One file, one source of truth.

Concrete examples from the fca project context

Example 1

[tool.ruff] line-length=100, target-version=py311.

Example 2

[tool.mypy] strict=true, follow_imports=silent for stubs.

Example 3

[tool.pytest.ini_options] asyncio_mode=auto, markers = [slow, integration].

Data flow / flow chart

pyproject.toml -> ruff, black, isort, mypy, pytest, coverage
  One change touches every tool

Takeaway

Centralize Python tooling in pyproject.toml — no more .flake8, .isort.cfg, setup.cfg cross-tool drift.