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

Switch to Pydantic v1 namespace and allow Pydantic v1 or v2 #168

Open
wants to merge 1 commit into
base: maint-0.x
Choose a base branch
from

Conversation

josephgruber-umbra
Copy link

@josephgruber-umbra josephgruber-umbra commented Oct 30, 2024

What I am changing

This change incorporates the use of the Pydantic v1 namespace which was introduced in Pydantic 1.10.17 and all 2.x versions. This allows the use of Pydantic v1 while also supporting either Pydantic >=1.10.17,<3. The goal being to allow users of this package a planned upgrade path to Pydantic 2.x instead of an abrupt switch.

See #166 for more on this issue

How I did it

  • Changed the Pydantic dependency to >1.10.18 (latest) and <3 (all 2.x versions)
  • Changing all Pydantic import statements to use the v1 namespace (e.g. from pydantic.v1 import ...)

How you can test it

  • Verified all existing unit tests pass
  • Verified existing functionality works as expected on private services

Reference

See the Pydantic migration guide which was updated to reference the new v1 namespace support back in August: https://docs.pydantic.dev/latest/migration/#continue-using-pydantic-v1-features

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

Successfully merging this pull request may close these issues.

1 participant