-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for pydantic 2.x #13
Conversation
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.
PR Type: Enhancement
PR Summary: The pull request aims to add compatibility for both pydantic 1.x and 2.x versions to the pykoplenti library. It includes updates to the CI workflow, documentation, and codebase to support and test against both versions of pydantic.
Decision: Comment
📝 Type: 'Enhancement' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
- Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
General suggestions:
- Ensure that the changes are thoroughly tested across all supported versions of pydantic to prevent any regressions.
- Consider adding more detailed comments or documentation around the version-specific code changes to aid future maintainers in understanding the compatibility layers.
- Review the use of conditional imports and type adapters to ensure that they are the most maintainable approach for supporting multiple versions of a dependency.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
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.
PR Type: Enhancement
PR Summary: The pull request introduces compatibility for both pydantic 1.x and 2.x within the pykoplenti library. It includes the addition of a wrapper function to handle the deprecated 'parse_obj_as' function from pydantic 1.x, updates to the CI pipeline to include testing with tox, and documentation updates to guide developers on how to run tests with the new setup.
Decision: Comment
📝 Type: 'Enhancement' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
- Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
General suggestions:
- Ensure that the new wrapper function for handling 'parse_obj_as' is thoroughly tested across both pydantic versions to prevent any regressions.
- Consider adding more detailed comments or documentation around the wrapper function to explain its purpose and usage for future maintainers.
- Review the changes to ensure that they follow the existing coding style and patterns within the project for consistency.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
Hey @stegm , I was monitoring home-assistant/core#99218 (comment), and noticed that this PR did not make to any release yet. I was wondering if you could do a release so that I can eventually request the upgrade on HA, to move the issue a little bit forward. |
Thank you for remembering. I have just created a release. |
Make pykoplenti compatible for pydantic 1.x and pydantic 2.x.
See also #12
tox
for testing the code with pydantic 1.x and pydantic 2.xparse_obj_as
function in pydantic 1.x