Skip to content

IEFS008: readme_dependency_groups

Every extra and dependency group a README command installs exists in the governing pyproject.toml.

Category: file_structure ยท Applies to: eval

What it does

Reads the commands in the README's fenced code blocks and inline code. In a uv command, every --extra X must name an extra under [project.optional-dependencies] and every --group X a group under [dependency-groups]. In a pip install (also pip3 and uv pip) or uv add command, every project[X] must name an extra of that project, when the project is this repository's or .. Fails once per missing name.

The governing pyproject.toml is the repository's, or, with isolated-packages-dir set, <isolated-packages-dir>/<name>/pyproject.toml when the evaluation has one. A uv command with --project, --directory or --package points elsewhere and is not checked, and neither is any command after a cd in the same code block. A pyproject.toml that is not valid TOML skips the rule.

Why is this bad?

uv sync --extra X fails outright when there is no extra X, and the reader is left to guess what to install. An evaluation that moves to its own package, or loses its extra, keeps the old install line, because nothing else checks hand-written install instructions, even in a repository whose README generator keeps its own sections up to date.

Example

uv sync --extra my_eval  # pyproject.toml has no my_eval extra

Use instead:

uv sync

Options

  • isolated-packages-dir

Suppress on a line with # inspect-evals-lint: ignore[IEFS008] -- <reason> or ignore[readme_dependency_groups] -- <reason>; select or ignore it in configuration by either, or by the prefix IEFS.