CogStack / MedCAT

Medical Concept Annotation Tool
Other
432 stars 102 forks source link

CU-8695d4www pydantic 2 #476

Open mart-r opened 1 month ago

mart-r commented 1 month ago

Let's see if we can do both pydantic 1 and pydantic 2.

This should in principle work with both.

Though I don't want to run GHA for both all the time. So I'll first run it for pydantic 2, then (if successful), change back to 1 and run it on that. And (if that's all good), change back to pydantic 2.

EDIT: I've now added something to the main GHA workflow that should catch any use of the .dict( method or the .__fields__ attribute from the pydantic1 era. However, this is only limited to those two (the only things that were previously being used). So if something else that doesn't work cross 1 and 2 is used, it wouldn't be caught. This could also at some point match other use cases unrelated the pydantic since it's a simple grep (it doesn't currently).

tomolopolis commented 1 month ago

Task linked: CU-8695d4www Support pydantic 2?

mart-r commented 1 month ago

NOTE: Now I've run through everything with both pydantic 1 and 2, so it should support either.

Though the issue is that any future changes would probably not be tested in any capacity on pydantic 1 (v2 will be installed by default).