-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
patch pydantic v1.10.9 conflict with py3.12 #2014
patch pydantic v1.10.9 conflict with py3.12 #2014
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2014 +/- ##
=======================================
Coverage ? 98.81%
=======================================
Files ? 38
Lines ? 4215
Branches ? 981
=======================================
Hits ? 4165
Misses ? 31
Partials ? 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
…' into fix/pydantic-1-10-9-with-py-3-12
While there is still one failing pipeline, this is the godspeed-benchmark, that isn't able to run on any PR's pipeline. |
CodSpeed Performance ReportMerging #2014 will not alter performanceComparing Summary
|
@koxudaxi, I had to change the |
) | ||
|
||
|
||
if '3.12' in sys.version: # pragma: no cover |
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.
Is this a problem that also occurs in, for example, Python 3.13?
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 checked this now with python v3.13.0-beta.2
and pydantic v2.8.0b1
(earliest version supporting python 3.13) and the problem does not occur. It seems like the broken ForwardRef
is really only happening for python 3.12
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.
@cclauss |
For performance reasons, you may also want to include a version check on the pydantic side. |
There are errors in pipelines that run the testing configuration
python=3.12
andpydantic=1.10.9
. The error is something like:and results in a massive amount of errors like:
To patch the missing
recursive_guard
keyword argument, I created apydantic_patch
file that gets imported early indatamodel_code_generator.__init__.py
and that patches the underlyingevaluate_forwardref
function.This PR is should fix most of the broken tests in the pipelines for pull requests #2013, #2009 and #2008.