feat: add typed configuration engine - #152
Draft
maxrjones wants to merge 5 commits into
Draft
Conversation
Adds donfig.typed: a schema-agnostic engine for statically-typed, dataclass-backed configuration on top of donfig's env/YAML ingestion. Consumers subclass TypedConfigManager[SchemaT] with a frozen-dataclass schema and get precise static types for both attribute and dotted-string access, immutable snapshots with a context-local overlay for scoped sets, and typo suggestions. Also ships a py.typed marker so donfig's types are visible to downstream type checkers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
==========================================
+ Coverage 98.46% 99.06% +0.59%
==========================================
Files 6 8 +2
Lines 784 1278 +494
==========================================
+ Hits 772 1266 +494
Misses 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
maxrjones
marked this pull request as draft
August 3, 2026 20:57
Member
|
This is currently set as a draft. Let me know if/when you want me to review it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the feature that the prior maintenance PRs were leading towards, namely a typed configuration engine. It satisfies users who want donfig's environment variable and YAML management but via a strictly typed dataclass (e.g., @d-v-b). Concretely, it is an upstreaming of the generic portion of Davis' PR for a statically-typed configuration object in zarr-python (zarr-developers/zarr-python#4101).
Davis (+Claude, I assume), actually wrote the code, whereas I just ported it here and added a docs page.