-
Notifications
You must be signed in to change notification settings - Fork 213
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
Relax pydantic, pydantic-settings, and uvicorn requirements #180
Conversation
2a61357
to
a1cd895
Compare
a1cd895
to
0d48a44
Compare
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.
This seems okay to me - for reference I also dug into the change logs for uvicorn and didn't see any issues.
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.
Sorry - I just realized that there is an inconsistency in my understanding here, is the comment correct? / what version of pydantic were you using when you needed the test change to make it pass?
# Normalize the my_model_a_with_default field to handle both pydantic formats | ||
if 'allOf' in actual_schema['properties']['my_model_a_with_default']: | ||
normalized_schema['properties']['my_model_a_with_default'] = { | ||
'$ref': '#/$defs/SomeInputModelA', |
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.
Seems odd to me that you've relaxed down to 2.7.2, but in order to get this test passing you cast it to the "Pre-pydantic 2.7.2" version.
I suspect either your comment is wrong, or I'm misunderstanding something
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.
Sorry, the comment was wrong. I researched exactly when this change was made and updated the comment to reflect it.
The change happened in Pydantic 2.9.0. Here are the release notes for that change. You can see the PR here that made the change.
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.
To confirm that this works, I ran the test with pydantic 2.7.2 (the new version we are relaxing to) and 2.10.1 (the previously required lower bound) and confirmed the test passes with both.
Motivation and Context
This PR relaxes version constraints for several dependencies to improve compatibility, without changing functionality.
pydantic
: Changed from>=2.10.1,<3.0.0
to>=2.7.2,<3.0.0
pydantic-settings
: Changed from>=2.6.1
to>=2.5.2
uvicorn
: Changed from>=0.30
to>=0.23.1
In addition to changing the version requirements, the main change in this PR is to fix a test that previously had been failing at pydantic 2.7.2, which had prompted @dsp-ant to upgrade the pydantic version. The relevant difference pre and post 2.7.2 pydantic was just in the JSON schema representation format. This fix was to make the test handle both pre-2.7.2 and post-2.7.2 pydantic JSON schema formats. Both schemas mean the same thing.
How Has This Been Tested?
I tested this by running the test suite with both pydantic 2.7.2, and 2.10.1, to confirm the tests passed for both. For uvicorn and pydantic-settings, I examined the change log and the usage of these libraries in the code to make sure there were no breaking changes.
Breaking Changes
There are no breaking changes here.
Types of changes
Relaxes dependency requirements, fixes a test that failed at an earlier dependency.
Checklist
Additional context