Skip to content

feat: add typed configuration engine - #152

Draft
maxrjones wants to merge 5 commits into
pytroll:mainfrom
maxrjones:typed-config
Draft

feat: add typed configuration engine#152
maxrjones wants to merge 5 commits into
pytroll:mainfrom
maxrjones:typed-config

Conversation

@maxrjones

Copy link
Copy Markdown
Contributor

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.

maxrjones and others added 3 commits July 1, 2026 13:24
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

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.06%. Comparing base (d2ccb82) to head (e706b1d).
⚠️ Report is 1 commits behind head on main.

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              
Flag Coverage Δ
unittests 99.06% <100.00%> (+0.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxrjones
maxrjones marked this pull request as draft August 3, 2026 20:57
@djhoese

djhoese commented Aug 4, 2026

Copy link
Copy Markdown
Member

This is currently set as a draft. Let me know if/when you want me to review it.

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.

2 participants