Replace Final model fields with a default with ClassVar

Proprietary

Pydantic 2.11 deprecates annotating a model field as Final with a default value (such fields were treated as class variables). Replace Final[X] = default with ClassVar[X] = default, which preserves the existing class-variable behavior and is the replacement Pydantic recommends.

org.openrewrite.python.migrate.pydantic.ReplaceFinalFieldWithClassVar
mod run . --recipe=org.openrewrite.python.migrate.pydantic.ReplaceFinalFieldWithClassVar

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.