Closed antazoey closed 10 months ago
Should be released as v0.6.0, coinciding with peer breaking change releases of evm-trace and ape
about to do something wicked with model JSON schema... Pydantic V2 is cool and will help us with our PackageManifest tool and FastAPI a lot.
What I did
Upgrades to pydantic v2, first pass.
fixes: #89 Fixes: APE-1408
How I did it
Tried following the migration guide.
Good News
Annotated
for most of the new types now - Pydantic V2 handles the restConfigDict
.RootModel
makes a lot more sense... You no longer need to do stuff like__root__=thing
, you can just havething
.Bad News
Hex
because it has new methods added, so the other option is not as recommended because it uses some stuff in pydantic that may change (according to them)sort_keys
and have custom separators, as json dumping kwargs are gone. There are new decoratored for firled serializers though, that is pretty neat, and even one for the whole model. However, it was still simpler to override the model dumping methods, however it feels wrong to sort the keys this way; I would like to find a better way.How to verify it
Checklist