label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

Pydantic 2.0 Migration / Support

Open strickvl opened this issue 1 year ago • 5 comments

Wondering whether the LS team have a Pydantic 2.0 migration on the roadmap for this year? As you probably know, security + maintenance fixes/support will stop for Pydantic 1.x this year.

At ZenML we're going to be migrating to use 2.x in the coming weeks and since there's a hard incompatibility between the local label_studio since it has a hard pydantic = "<=1.11.0,>=1.7.3" dependency.

I realise that the Python SDK is much more relaxed which probably is enough for us to work around. We'd just have to remove support for running LS locally in our examples / use case and instead suggest people deploy LS somewhere.

I'm wondering, though, whether there is a plan to migrate to Pydantic 2.x. Thanks!

strickvl avatar Mar 01 '24 16:03 strickvl

Are there any breaking changes in pydantic2? If no, we will upgrade soon, especially if there are any security issues.

makseq avatar Mar 16 '24 15:03 makseq

https://docs.pydantic.dev/2.6/migration/ this is the migration guide. If you're not doing anything too fancy with Pydantic you might find that you can run their migration script and everything just works. If you're unlucky, it'll be a bit of work to handle.

strickvl avatar Mar 16 '24 16:03 strickvl

Any updates on this?

strickvl avatar May 23 '24 13:05 strickvl

At this moment we haven't yet switched to pydantic v2.

makseq avatar May 23 '24 13:05 makseq

Got it. I guess you'll be forced soonish in due course. In any case, at ZenML we're strongly motivated by various integrations to upgrade (since they start not working any more, not to mention the lack of bug fixes / security support for Pydantic starting in the next month or two), which means that probably we'll need to remove support for locally running label_studio in the way we previously suggested people do it (i.e. using the label_studio package itself). Our integration mainly uses label_studio_sdk package to interact with the instance, so that part is fine as you have much more relaxed pydantic requirements there. So I guess we'll encourage people to spin up LS with Docker or perhaps HF Spaces as their way to easily get started.

strickvl avatar May 23 '24 13:05 strickvl