Skip to content
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

Pydantic models for Plugin Config #899

Merged

Conversation

SpecialBuilder32
Copy link
Member

This PR refactors how our beet.yaml metadata is read into many of our build plugins, using the intended system of pydantic models rather than arbitrary dict access. This change allows for a much clearer definition of what options are available/expected and in what format.

Also included in this PR (and its impetus), is the addition of the search_keywords config option for the website.

@RitikShah
Copy link

RitikShah commented Sep 18, 2023

I skimmed through it, happy to review when you think it's ready. I would stick with either Optional[type] or type | None (whichever you prefer),

BTW, beet is still on Pydantic v1.x and not v2.x so make sure you are reading the correct docs for that!

@SpecialBuilder32
Copy link
Member Author

Yep! I leaned pydantic while working on the RP merge, which has a by far more complex set of models.

I've been using str|None when the expected value is either null or foo, and Optional[] for when the argument isn't required to be set

..and yes I fear the update to pydantic 2 when I'll have to redo everything :(

@Bloo-dev
Copy link
Member

I can't find any reference to search_keywords in the code of this PR, did you forget to commit that?

@SpecialBuilder32
Copy link
Member Author

I can't find any reference to search_keywords in the code of this PR, did you forget to commit that?

I'm still working on converting to the new models and verifying that doesn't break anything before adding new stuff

@SpecialBuilder32 SpecialBuilder32 marked this pull request as ready for review September 22, 2023 17:45
@SpecialBuilder32 SpecialBuilder32 merged commit 3943e7a into Gamemode4Dev:master Sep 22, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants