-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove Python 3.8 Support #11258
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
Remove Python 3.8 Support #11258
Conversation
Deploying pydantic-docs with
|
Latest commit: |
e7b5413
|
Status: | ✅ Deploy successful! |
Preview URL: | https://abce33e6.pydantic-docs.pages.dev |
Branch Preview URL: | https://3-8-removal.pydantic-docs.pages.dev |
CodSpeed Performance ReportMerging #11258 will improve performances by 16.74%Comparing 🎉 Hooray!
|
Benchmark | main |
3.8-removal |
Change | |
---|---|---|---|---|
⚡ | test_list_of_models_serialization |
58.4 µs | 53.4 µs | +9.18% |
⚡ | test_complex_model_validation[__init__] |
54.8 µs | 49.4 µs | +10.94% |
⚡ | test_complex_model_validation[model_validate] |
55.2 µs | 50.1 µs | +10.17% |
⚡ | test_list_of_models_validation[__init__] |
94 µs | 82.1 µs | +14.53% |
⚡ | test_list_of_models_validation[model_validate] |
92.3 µs | 79.1 µs | +16.74% |
⚡ | test_nested_model_validation[__init__] |
57.1 µs | 51.7 µs | +10.49% |
⚡ | test_nested_model_validation[model_validate] |
54.5 µs | 50.1 µs | +8.88% |
⚡ | test_simple_model_validation[__init__] |
40.4 µs | 36.6 µs | +10.31% |
⚡ | test_simple_model_validation[model_validate] |
40.7 µs | 38.4 µs | +5.97% |
⚡ | test_north_star_dump_python |
18.3 ms | 16.8 ms | +8.86% |
⚡ | test_north_star_json_loads |
21.8 ms | 19.5 ms | +11.85% |
⚡ | test_north_star_validate_json |
54 ms | 49.1 ms | +10.17% |
⚡ | test_north_star_validate_json_strict |
53.8 ms | 48.9 ms | +10.03% |
⚡ | test_north_star_validate_python |
45.7 ms | 40.7 ms | +12.33% |
⚡ | test_north_star_validate_python_strict |
35.3 ms | 31.1 ms | +13.49% |
assert str(devtools.debug.format(obj)).split('\n')[1:] == [ | ||
' Obj(', | ||
' int_attr=42,', | ||
" str_attr='Marvin',", | ||
' ) (Obj)', | ||
] | ||
if sys.version_info < (3, 11): | ||
assert str(devtools.debug.format(obj)).split('\n')[1:] == [ | ||
' Obj(', | ||
' int_attr=42,', | ||
" str_attr='Marvin',", | ||
' ) (Obj)', | ||
] | ||
else: | ||
assert str(devtools.debug.format(obj)).split('\n')[1:] == [ | ||
' obj: Obj(', | ||
' int_attr=42,', | ||
" str_attr='Marvin',", | ||
' ) (Obj)', | ||
] |
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 change is just related to a version bump in uv.lock
. The only one of its kind in this PR.
tests/test_generics.py
Outdated
@@ -1466,9 +1466,6 @@ class InnerModel(OuterModelA[K, V], OuterModelB[T], Generic[K, V, T]): | |||
} | |||
|
|||
|
|||
# TODO: SYDNEY - determine changes to make here (next 4 tests with 3.9 notes) | |||
|
|||
|
|||
def test_generic_with_referenced_generic_type_1(): |
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.
@Viicos, I don't think I fully understand the changes you want made to these functions, perhaps you could help me out on this part? Thanks!
Coverage reportClick to see where and how coverage changed
The report is truncated to 25 files out of 36. To see the full report, please visit the workflow summary page. This report was generated by python-coverage-comment-action |
7e5640d
to
7952c25
Compare
5daa2de
to
6b6a565
Compare
I'm guessing test failures are related to:
Looking into this now. |
c1d2afe
to
045a632
Compare
e152733
to
f2b4672
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.
Just checking: do we have a single test testing for typing.Dict/List/etc
? So that we gather this as a single test, and then safely use the builtins in other tests (and we are still assured that the old constructs are supported).
No, we should probably do this. How detailed do you think we need to be here? Ex - parametrization with forwardrefs, etc... |
Done via tests/test_types.py:test_pep585_generic_types |
Includes #11257 changes (with temp bound on
pydantic-extra-types
).Exciting diff here!
zoneinfo
importsLiteral
,Annotated
, etc fromtyping
nottyping_extensions
(docs examples, too)typing.Dict
,typing.List
, etcruff
target version to 3.9 to enforce fixes :)Note: not touching
v1
files.Best reviewed commit by commit, hiding whitespace. Would not recommend looking file by file.
I've commented on some of the more important / relevant changes below.