Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade pydantic to v2 #13983

Open
adrijanik opened this issue Nov 15, 2023 · 6 comments
Open

feat: Upgrade pydantic to v2 #13983

adrijanik opened this issue Nov 15, 2023 · 6 comments
Labels
feature-request A request for a new feature or a change that isn't a bug. May require further triage or scoping.

Comments

@adrijanik
Copy link

adrijanik commented Nov 15, 2023

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.

@adrijanik adrijanik added the feature-request A request for a new feature or a change that isn't a bug. May require further triage or scoping. label Nov 15, 2023
@SyntaxColoring
Copy link
Contributor

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
Copy link

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

@SyntaxColoring
Copy link
Contributor

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
Copy link

Hello @SyntaxColoring, any updates on this?

@SyntaxColoring
Copy link
Contributor

Latest update: #14871 (comment)

@strangemonad
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A request for a new feature or a change that isn't a bug. May require further triage or scoping.
Projects
None yet
Development

No branches or pull requests

5 participants