Skip to content

👌 Honor -D overrides when loading needs_from_toml#1717

Merged
chrisjsewell merged 1 commit into
masterfrom
config-overrides-toml
May 27, 2026
Merged

👌 Honor -D overrides when loading needs_from_toml#1717
chrisjsewell merged 1 commit into
masterfrom
config-overrides-toml

Conversation

@chrisjsewell

Copy link
Copy Markdown
Member

Keep Sphinx CLI config overrides (-D / confoverrides) authoritative in load_config_from_toml by skipping TOML assignments for keys that were already overridden.

  • Read override keys from config.overrides
  • Skip setting needs_<key> when <key> or needs_<key> is overridden
  • Skip setting schema entries when needs_schema_ or needs_schema_<key> is overridden
  • Add regression test verifying TOML does not overwrite needs_reproducible_json when provided via confoverrides

This preserves expected precedence: CLI overrides > TOML values > defaults.

Keep Sphinx CLI config overrides (`-D` / `confoverrides`) authoritative in
`load_config_from_toml` by skipping TOML assignments for keys that were already
overridden.

- Read override keys from `config.overrides`
- Skip setting `needs_<key>` when `<key>` or `needs_<key>` is overridden
- Skip setting schema entries when `needs_schema_` or `needs_schema_<key>` is overridden
- Add regression test verifying TOML does not overwrite `needs_reproducible_json`
  when provided via `confoverrides`

This preserves expected precedence: CLI overrides > TOML values > defaults.
@chrisjsewell chrisjsewell requested a review from ubmarco May 27, 2026 07:03
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.38%. Comparing base (4e10030) to head (4b12009).
⚠️ Report is 290 commits behind head on master.

Files with missing lines Patch % Lines
sphinx_needs/needs.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1717      +/-   ##
==========================================
+ Coverage   86.87%   89.38%   +2.50%     
==========================================
  Files          56       74      +18     
  Lines        6532    10592    +4060     
==========================================
+ Hits         5675     9468    +3793     
- Misses        857     1124     +267     
Flag Coverage Δ
pytests 89.38% <81.81%> (+2.50%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ubmarco ubmarco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change

@chrisjsewell chrisjsewell merged commit 8239a7b into master May 27, 2026
24 checks passed
@chrisjsewell chrisjsewell deleted the config-overrides-toml branch May 27, 2026 07:17
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