CI Perf Lint

outdated-pydantic-v2

Why it matters

Pydantic’s schema build happens at import/startup time and is a long-standing V2 cost. Several v2 releases made large improvements:

CI jobs, CLIs, and serverless startups that import many models pay this cost on every run. Staying on a v2 release below 2.13 keeps that cost higher than necessary.

What it flags

The rule reports dependency files that constrain pydantic to a v2 release that cannot resolve to 2.13 or newer:

It does not flag:

Suggested action

Raise the pydantic requirement to >=2.13 (2.13.x or newer) and refresh the lockfile.

Verification

Compare model import, schema-build/startup time, validation/serialization throughput, and peak memory in CI before and after upgrading pydantic.

What the scanner does

Dependency files are read as text: pyproject.toml, requirements*.txt, setup.cfg, setup.py, Pipfile, Pipfile.lock, and poetry.lock. Version specifiers are parsed into lower/upper bounds; a pydantic v2 requirement is flagged when its upper bound is below 2.13 (or it is pinned below 2.13). Complex or dynamic version specifiers may not be detected.

Sources