-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: add v1 namespace #8
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
==========================================
+ Coverage 94.69% 94.73% +0.03%
==========================================
Files 8 9 +1
Lines 264 266 +2
==========================================
+ Hits 250 252 +2
Misses 14 14
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean... I wouldn't do the *
, but fine. 😂
I retract the * thing. 😂 |
Wow. Thanks @tlambert03 ! Some backchannel communication happening there across 3 continents :-) |
src/pydantic_compat/v1.py
Outdated
@@ -0,0 +1,5 @@ | |||
"""This module is a try/except wrapper the pydantic.v1 namespace.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
around or that wraps the pydantic.v1 namespace ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, typo. will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I elaborated it to this:
"""This module is a try/except pass-through for the pydantic.v1 namespace.
The pydantic.v1 namespace was added in pydantic v2. It contains the entire
pydantic v1 package. For packages that would like to unpin their 'pydantic<2'
dependency without needing to update all of their code to use the pydantic v2 api,
this provides a simple way to delay that update.
This is different from the goal of pydantic_compat on the whole, which is to provide
an API translation layer that allows you to actually use pydantic v2 features
(e.g. rust-backed speed, etc...) while also being compatible with packages that pin
pydantic<2.
"""
This reverts commit 33b2662.
from pydantic_compat.v1 import BaseModel
alias for