-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
feat(internal): msgspec signature model and pydantic v2 support. #1854
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.
Looks good.
The aim is to replace the other models with this, correct?
Yes that's the plan! I'm just trying to get the tests passing with as few changes as possible, but ran out of time. Will pick up again tomorrow. |
0188b6c
to
7dd6301
Compare
2b0f7fe
to
713f9b2
Compare
The remaining failures are from exception handling/error formatting. |
616bef4
to
3bf416c
Compare
3bf416c
to
f2300ef
Compare
b7cb2e2
to
2b43b07
Compare
I rebased this on main and updated the implementation to align. I also squashed the previous commits together - so its easier to rebase. I am going to branch from this now. |
5f79d7e
to
12e35f2
Compare
12e35f2
to
d8f8c9e
Compare
I removed the pydantic and attrs logic and refactored the code, also fixed most tests. The only remaining issue for now is the error handling. |
27ab921
to
5c7eee5
Compare
I merged the pydantic v2 support into this one. So it can be handled together. |
@Goldziher This is not ready for review at all. There are several things that need to be handled before this can go in. |
such as? |
The error handling will require a lot of substantial changes for example, and the support for Pydantic and attrs is only preliminary, since the intended solution (via plugins) hasn't been implemented yet. I don't see why this has to be merged now, in an unfinished state, when we will then have to go back and alter is fundamentally again. |
we do not need to alter it IMO. We can opt to alter it - but that can be done in iterations and is elective. In fact - IMO it should not go into this PR - whatever needs to come later, can come later and is not a blcoker here. The attrs and pydantic stuff is fully functional noe. That is - it serializes, deserializes and generates schemas correctly. Anyhow, i made a thread in discord. |
Linting fixes. Update tests/unit/test_kwargs/test_path_params.py fix signature namespace issue support min_length and max_length support min_length and max_length handle constraints on union types fix error message tests chore(signature-model): remove pydantic and attrs signature models chore(signature model): fix python 3.8 compat
2f98428
to
8f97076
Compare
Yes we do, unless we don't care about breaking exceptions completely.
It is not. As I said before, the handling of the exception will require substantial changes, and those are not ready at the moment. |
the only thing that requires changes is the exception handling. But that is a given. |
94973c3
to
5031d2b
Compare
* feat(internal): add pydantic v2 support Linting fixes. Update tests/unit/test_kwargs/test_path_params.py fix signature namespace issue support min_length and max_length support min_length and max_length handle constraints on union types fix error message tests chore(signature-model): remove pydantic and attrs signature models chore(signature model): fix python 3.8 compat feat: msgspec signature model. Linting fixes. Update tests/unit/test_kwargs/test_path_params.py fix signature namespace issue support min_length and max_length support min_length and max_length handle constraints on union types fix error message tests chore(signature-model): remove pydantic and attrs signature models feat: msgspec signature model. Linting fixes. Update tests/unit/test_kwargs/test_path_params.py fix signature namespace issue support min_length and max_length support min_length and max_length handle constraints on union types fix error message tests feat(signature-model): add pydantic v2 support * feat(internal): handle pydantic errors --------- Co-authored-by: Peter Schutt <peter.github@proton.me>
5031d2b
to
6a7af34
Compare
f22961c
to
65e1177
Compare
5931426
to
7354ab7
Compare
7354ab7
to
d21ee1f
Compare
SonarCloud Quality Gate failed. 0 Bugs 92.8% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/1854 |
This PR migrates to using msgspec as the basis for signature modelling. It removes the dependency on attrs and pydantic for this purpose and switching to using msgspec exclusively.