8000 feat: deprecate the config_file constructor argument by marcgibbons · Pull Request #158 · lincolnloop/goodconf · GitHub
[go: up one dir, main page]

Skip to content

feat: deprecate the config_file constructor argument - #158

Merged
marcgibbons merged 1 commit into
mainfrom
deprecate-config-file
Nov 27, 2026
Merged

marcgibbons merged 1 commit into
mainfrom
deprecate-config-file

Conversation

@marcgibbons
@marcgibbons marcgibbons commented Nov 27, 2026 •
Copy link
Copy Markdown
Contributor
  • GoodConf(config_file=...) emits a DeprecationWarning; behaviour unchanged
  • Tests assert the exact warning message and that it points at the caller

Why: config_file= (undocumented) picks a file that sticks for one load() only.

  • A later config.load(), e.g. in settings.py after django_manage, silently falls back to file_env_var / default_files, so the config changes under you
  • It outranks manage.py -C in spawned workers (test --parallel), so the parent and its workers can read different files (see fix: read the manage.py -C file from settings.py's config.load() #156)
  • It duplicates default_files, file_env_var and load(path), which don't have these problems

Removing it leaves one way to pick a file per need, and the same file for every load and every process.

It is undocumented and only applies to the first load(). default_files or load(path) cover the same uses.
@marcgibbons
marcgibbons force-pushed the deprecate-config-file branch from f9673cf to 7672819 Compare November 27, 2026 17:51
@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 (1b052fe) to head (7672819).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #158   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          959       977   +18     
  Branches         6         6           
=========================================
+ Hits           959       977   +18     
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 18:00
@marcgibbons
marcgibbons merged commit 8a36447 into main Nov 27, 2026
15 checks passed
@marcgibbons
marcgibbons deleted the deprecate-config-file branch November 27, 2026 18:38
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.

1 participant

0