SINTEF / soft7

SINTEF Open Framework and Tools for Data Driven Semantic Interoperability
https://sintef.github.io/soft7
MIT License
4 stars 0 forks source link

Update to pydantic v2 #16

Closed CasperWA closed 1 year ago

CasperWA commented 1 year ago

Use new way of configuring models and new type of validators.

Closes #12

I put this as a draft for now, to determine whether other parts of the code should be re-written according to new pydantic v2 functionality. Like, e.g., the dynamic model creation using create_model().

Furthermore, since dependencies of this package pin pydantic to v1 still, it is difficult to see an update happening right now.


~This PR now does a few things, along with migrating to pydantic v2~ (EDIT: Nope, it just migrates):

CasperWA commented 1 year ago

@quaat and @Treesarj, I think I'll merge this. It shouldn't change any contents, really, just update usage of pydantic to pydantic v2 styling - and then there's a bit of static typing updates as well.

Since both oteapi-core and otelib now support pydantic v2, there are no dependency issues any longer.