8000 Switching to `pydantic_core` by samuelcolvin · Pull Request #4516 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

Switching to pydantic_core #4516

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

Merged
merged 70 commits into from
Nov 2, 2022
Merged

Switching to pydantic_core #4516

merged 70 commits into from
Nov 2, 2022

Conversation

samuelcolvin
Copy link
Member
@samuelcolvin samuelcolvin commented Sep 14, 2022

This is the big one 😱.

I'd love @PrettyWood @hramezani @tiangolo @adriangb and others to review this. Having to fix some suggestions, but given how big this is, I might defer some suggestions to subsequent PRs.

I'm sorry there's so much noise - obviously it would be great if the interesting bits could be in a different PR to the refactoring, but that wasn't possible while keeping tests "passing".

Test situation now:

  • 1367 passed
  • 92 skipped
  • 732 xfailed - marked as allowed to fail to keep CI passing
  • 210 xpassed - in files marked as allowed to fail, but passing

There's a lot still to do, but the core functionality is now working using pydantic-core.

Summary of changes

  • internal logic has been move (mostly) into the _internal module - this is to provide a clear differentiating between the public API and internal functions
  • Type constraints (like constr, UUID5 FilePath) having been converted to type annotations, although some have an alias to simplicity
  • Most of the logic to generate pydantic-core schema from python types is done
  • test modules that are mostly failing (or make no sense at the moment) have been marked as xfail, as features are fixed, we can remove the xfails and fix the tests
  • mypy, pyright and linting are passing (though the mypy tests are currently xfail), fixed
  • docs examples are not run at the moment, re-building docs is probably the biggest thing to do
  • model methods like dict() have not yet been renamed, we'll do that on a future PR

Before merging we need to decide on pydantic/pydantic-core#307.


In terms of next steps, I'm going to create issues now rather than listing here.

@samuelcolvin samuelcolvin changed the title Babelfish Switching to pydantic_core Sep 14, 2022
Copy link
Contributor
@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMAZING! 🚀 🎉

I love the new structure for users. I read all the code in this PR. Not sure how much I understood but I read it all. 😅

It all looks great! I just added some minor comments.

Copy link
Member
@hramezani hramezani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👍 🚀

samuelcolvin and others added 3 commits November 2, 2022 10:26
Suggestions from @tiangolo and @hramezani 🙏

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
@samuelcolvin samuelcolvin merged commit 594effa into main Nov 2, 2022
@samuelcolvin samuelcolvin deleted the babelfish branch November 2, 2022 12:01
@samuelcolvin
Copy link
Member Author

💥 🚀

@kabartay
Copy link
kabartay commented Nov 2, 2022

That's incredible progress.
Great efforts to review and test such a monster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants
0