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

Bump Pydantic version to 2.x #45

Open
tr11 opened this issue Jul 25, 2023 · 1 comment
Open

Bump Pydantic version to 2.x #45

tr11 opened this issue Jul 25, 2023 · 1 comment

Comments

@tr11
Copy link

tr11 commented Jul 25, 2023

Pydantic released their 2.x version earlier last month, which is causing a little bit of issues when trying to use permit on projects that already use the new version, namely with fastapi.

Would it be possible to bump the requirements to update pydantic to >= 2.0? They offer an easy way to use it with the new 2.x branch, according to their docs:

The Pydantic V2 package also continues to provide access to the Pydantic V1 API by importing through pydantic.v1. For example, you can use the BaseModel class from Pydantic V1 instead of the Pydantic V2 pydantic.BaseModel class:

from pydantic.v1 import BaseModel
@asafc
Copy link
Contributor

asafc commented Sep 20, 2023

hi @tr11, thanks for opening this issue, we are looking into a solution!

Just FYI, the suggested solution won't work because it forces the users of the permit library to upgrade pydantic to v2.
They might not be able to, because a migration might be quite difficult depending on the project.

What we'll do is either build a cross compat layer or remove pydantic altogether from this SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants