CI Perf Lint

prefer-pydantic-v2

Detects Python dependency files that pin or request Pydantic v1.

What it detects

Why it matters

Pydantic v2 is up to 50x faster and uses less memory than v1. The pydantic.v1 compatibility shim lets you upgrade first and migrate code incrementally.

Suggested action

Upgrade to Pydantic v2 and update any broken code. If you need temporary compatibility, use the pydantic.v1 compatibility shim after upgrading:

from pydantic.v1 import BaseModel

Then migrate incrementally to native v2 APIs.

Measurement

Profile model validation throughput before and after migration.

Compatibility notes