-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use a common configuration model #374
Conversation
053f44d
to
b74a405
Compare
Ah, |
Would it not be amasing if tests showed the entire error output? |
c385c6f
to
a78e908
Compare
892bade
to
ad62d1b
Compare
Ah fuck, the zipapp bootstrapping fails because |
@duckinator I could turn all the models into dataclasses, and write our own more-basic input validation layer... but I'm honestly unsure whether we should prioritize Bork itself being available as a zipapp, or maintainability. |
1187dfd
to
3d63953
Compare
3d63953
to
dd796f6
Compare
@duckinator that's ready-to-review and CI is green 🎉 All in all I'm pretty happy, we are getting to a point where type-checking is able to find bugs (whereas before, too much of the codebase was untyped and |
@nbraud sorry, I somehow got distracted from looking at this until today. I like this overall, but I'd like some kind of test for building ZipApps (even if not of Bork). |
This should capture the entirety of Bork's runtime configuration, with the exception of CLI arguments (for now)
That's an extra zipapp-happy testcase.
936a40a
to
883869f
Compare
Done! |
Model the configuration with Pydantic, and convert the rest of Bork to use that rather than
load_pyproject
and raw dicts.This shouldn't change the actual configuration schema, merely document and validate it.
Rationale
Previously, each use of a config entry had its own idea about that
+37 -60 lines, excluding the model's implementation and removal of
load_pyproject
Drawbacks
Pydantic is a new dependency, with
pydantic_core
weighing ~2 MiB.I don't think it matters all that much: Bork is a development tool, and its latest release was already 5 MiB.