You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @ringohoffman - I took a cursory look at upgrading to pydantic v2, it wasn't just a straight upgrade (I had some trouble with the nested configuration models for default configuration) but definitely something that's high on the list!
Re upgrade: I noticed the following:
After pydantic/pydantic#6722 I realised tomlkit parsed into its own types rather than builtin Python types, and Pydantic V2 isn't coercing them like v1 so it "looks like" valid TOML is invalid according to the Config model.
I tried swapping tomlkit for tomli and tomli-w, as tomli does parse TOML into builtin Python types - however, tomli_w reformatted the TOML file when it was written out. Maybe not the worst crime but I was reluctant to just throw that in. I didn't really want to use two TOML parsing libraries (especially as there's also a builtin one in 3.11+), so need to figure a way out to make all these things work together - hoping there's a "coerce" setting for pydantic v2 models that I've missed
Description
Use cases
This would support consumers who depend on
pydantic>2.0
.Possible implementation
It seems like this code base mostly relies on basic
pydantic.dataclasses.dataclass
andpydantic.BaseModel
functionality, so I would bet that we could just unpin pydantic and it would still work.The text was updated successfully, but these errors were encountered: