Skip to content

fix: ignore global-only config items in project pdm.toml - #4043

Merged
frostming merged 2 commits into
mainfrom
fix/project-config-global-only
Nov 30, 2026
Merged

frostming merged 2 commits into
mainfrom
fix/project-config-global-only

Conversation

@frostming

Copy link
Copy Markdown
Collaborator

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

Global-only config items (e.g. venv.location, python.install_root, pypi.ca_certs, pypi.client_cert) were only rejected when written through pdm config -l. A hand-written project pdm.toml could still set them, and because the project config takes precedence over the global config, they took effect.

  • Project config now drops global-only items (including deprecated aliases of them) when loading the file, and warns that they are ignored. This also covers the legacy .pdm.toml migration path.
  • Env vars for those items still apply, since they come from the env map rather than the file.
  • The site config (Config.site) is loaded via Config(...) without is_global, so a new keyword-only allow_global_only flag keeps global-only items working there. The write-time check uses the same flag.

Tests: test_project_config_ignores_global_only_items (fails before the fix) and test_site_config_keeps_global_only_items.

🤖 Generated with Claude Code

frostming and others added 2 commits November 30, 2026 11:00
Global-only items were only rejected when written via `pdm config -l`,
but a hand-written project `pdm.toml` could still set them and take
precedence over the global config. Drop them on load with a warning.
The site config is still allowed to set them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frostming
frostming marked this pull request as ready for review November 30, 2026 03:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T03:05:27.671165Z 787e0e8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4043      +/-   ##
==========================================
+ Coverage   89.69%   89.70%   +0.01%     
==========================================
  Files         120      120              
  Lines       13704    13718      +14     
  Branches     2354     2357       +3     
==========================================
+ Hits        12292    12306      +14     
  Misses        877      877              
  Partials      535      535              
Flag Coverage Δ
unittests 89.60% <100.00%> (+0.01%) ⬆️

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.

@frostming
frostming merged commit 2658594 into main Nov 30, 2026
26 checks passed
@frostming
frostming deleted the fix/project-config-global-only branch November 30, 2026 03: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.

1 participant