-
-
Notifications
You must be signed in to change notification settings - Fork 7
[feat] support user-provided base models #42
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
base: main
Are you sure you want to change the base?
Conversation
Never mind, figured out you had a non-standard |
bab7f30
to
7d73e90
Compare
…rty Pydantic base models
7d73e90
to
8bc318c
Compare
assert "pydantic-field" not in package["Model.a"].labels | ||
|
||
|
||
def test_extra_bases() -> None: |
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'm not sure if it's a good test since both classes are implemented in the same package. Should we split them to separate packages? or what's the best way to test this?
Yeah we provide a About NixOS / PDM, not sure why pdm-backend wouldn't work on this OS 🤷 We're using uv too, but building the project with pdm-backend (which is transparently installed as a Python package, in a temp venv, by uv when building, so it should work on any OS really). Let's decide on the issue whether the |
I guess I was too quick with my judgement: indeed So, as mentioned in #41, preloading |
Basically the same as #30 except imports done inline rather than pulling out to separate functions |
For reviewers
Description of the change
Add a new configuration option:
extra_bases
. This allows extending the default list (pydantic.BaseModel
,pydantic.main.BaseModel
) with third-party base pydantic classes.Relevant resources
Resolve #41, #14, #27