Opentrons / opentrons

Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2
https://opentrons.com
Apache License 2.0
426 stars 179 forks source link

feat: Upgrade pydantic to v2 #13983

Open adrijanik opened 1 year ago

adrijanik commented 1 year ago

Overview

Hi team,

Do you have any plans to upgrade pydantic to v2 from v1.8.2? Is there maybe any branch that I could use if such transition is happening? It becomes a problem when you want to use opentrons library in a project where packages dependencies requires pydantic v2. I couldn't find any issue that address that.

Thanks!

Implementation details

I haven't tested that, but this could be a simple fix by using v1 apis from within v2 version, see below: from pydantic.v1 import BaseModel

There is also a helper package bump-pydantic which may help with that. Here is also a migration guide.

Design

No response

Acceptance criteria

Lift the dependency from pydantic 1.8.2 to pydantic >=2.

SyntaxColoring commented 1 year ago

Yeah, we definitely want to upgrade Pydantic. (Internal reference: RSS-227)

Unfortunately we haven't started that work yet, so there's no branch you could use. We don't have a timeline for it, since we're focusing on the new Opentrons Flex.

There is also a helper package bump-pydantic which may help with that. Here is also a migration guide.

This is helpful. Thank you!

ChrisTwig commented 8 months ago

Hello @SyntaxColoring is there any proposed plan for this? You could even use the new namespace pydantic.v1

SyntaxColoring commented 7 months ago

Sorry for the lack of updates here. Yes, we're working on this in PR #14871. It's not our first priority, though, so I can't promise it will be completed soon.

silvioscience commented 4 months ago

Hello @SyntaxColoring, any updates on this?

SyntaxColoring commented 3 months ago

Latest update: https://github.com/Opentrons/opentrons/pull/14871#issuecomment-2294227559

strangemonad commented 1 month ago

please please please prioritize this. Pydantic should have fixed many import perf issues. It's a major pain that we can't easily interoperate between core models in parts of our codebase.