-
Notifications
You must be signed in to change notification settings - Fork 70
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
Use Pydantic v1 API even with pydantic v2 #314
Conversation
This PR changes all imports to test against Pydantic v2 and then uses the v1 api if found. Precursor to future v2 migration. Also updates the CI to test against both versions. Hopefully I figured out Poetry correctly.
I like your From https://stackoverflow.com/a/70632360 , I think your attempts to manipulate poetry in the GHA through pyproject.toml groups might not be allowed b/c extras not exclusive. Poetry seems ... uncooperative ... for this purpose. I wonder if a workaround is to return pyproject.toml to |
The I was worried about the Poetry part because it does say it'll resolve all optional dependencies in the tree too, which really makes me wonder why they don't allow superseding versions of dependencies such as for dev versions.
I'm willing to try something to this effect, I just wont have time to get to it this weekend, so don't let this PR get in the way of other PR's/releases you want to do. |
…inplace sed to pin pydantic version to 1.0 (assuming the spec remains >=1.y.z for now)
…o everything just ever so slightly differently.
Okay, this should be ready to go! Failing error is not related to the functional code (just the doc building which is also pydantic problems but not in the way of using the code) @loriab the |
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.
Hooray, thanks for finding that pydantic.v1
workaround so we don't have to be so restrictive. I'll give the build error a try elsewhere.
The build error has to do with the |
Ok, I was thinking your |
Thats actually a great idea. I've added the |
Description
This PR changes all imports to test against Pydantic v2 and then uses the v1 api if found. Precursor to future v2 migration.
Also updates the CI to test against both versions. Hopefully I figured out Poetry correctly.
Changelog description
Compatibility with Pydantic v2 but use the v1 API as a stopgap for the version pin.
Status