8000 feat: add GoodConf.is_loaded by marcgibbons · Pull Request #161 · lincolnloop/goodconf · GitHub
[go: up one dir, main page]

Skip to content

feat: add GoodConf.is_loaded - #161

Merged
marcgibbons merged 6 commits into
mainfrom
is-loaded
Nov 27, 2026
Merged

marcgibbons merged 6 commits into
mainfrom
is-loaded

Conversation

@marcgibbons
Copy link
Copy Markdown
Contributor

Supersedes #106 (rebased; original commit kept)

  • config.is_loaded is True once loaded, so callers can skip a repeat load() (e.g. settings.py after django_manage already loaded)
  • Opt-in: load() behaviour and the recommended settings.py usage unchanged; README documents the attribute
  • Pydantic 2.12 floor bump dropped: it only worked around legacy test_all_env_vars, which mocks BaseSettings.__init__; test removed, its case pinned in test_load_without_file_uses_env

apollo13 and others added 6 commits November 27, 2026 14:03
It mocks BaseSettings.__init__, so pydantic 2.7 never initialises private
attributes and setting _is_loaded fails. test_load_without_file_uses_env
covers the same behaviour through a real load.
- getattr default instead of try/except AttributeError
- one test per load path
- README documents the attribute; changelog entry under Unreleased
Covers the case the dropped legacy test_all_env_vars exercised.
@codecov
codecov Bot commented Nov 27, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b6a58ba) to head (6a3255f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #161   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          986       995    +9     
  Branches         6         6           
=========================================
+ Hits           986       995    +9     
Flag Coverage Δ
dev 100.00% <100.00%> (ø)
py311-django52 100.00% <100.00%> (ø)
py312-django60 100.00% <100.00%> (ø)
py313-django60 100.00% <100.00%> (ø)
py314-django60 100.00% <100.00%> (ø)
py315-django61 100.00% <100.00%> (ø)

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.

@marcgibbons
marcgibbons marked this pull request as ready for review November 27, 2026 19:23
@marcgibbons
marcgibbons merged commit 6edc32c into main Nov 27, 2026
15 checks passed
@marcgibbons
marcgibbons deleted the is-loaded branch November 27, 2026 19:23
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

0