Skip to content

Fix Click default option handling#60

Open
shenxianpeng wants to merge 4 commits intomainfrom
codex/click-upper-bound
Open

Fix Click default option handling#60
shenxianpeng wants to merge 4 commits intomainfrom
codex/click-upper-bound

Conversation

@shenxianpeng
Copy link
Copy Markdown
Member

@shenxianpeng shenxianpeng commented Apr 29, 2026

Summary

Fix Click default handling in the CLI entry points instead of capping Click below 8.3.0.

closes mkdocs/mkdocs#4055

Recent Click releases changed or briefly regressed how default values are represented for boolean flag pairs and flag-value options. MkDocs uses several tri-state command options where an omitted CLI flag must remain None so the config file can decide the final value. The CLI now checks Click's parameter source and restores default-sourced values for those options to None, while preserving explicit command-line values such as --no-directory-urls.

This keeps Click open for future patch and security updates while preventing omitted options from overriding configured strict, use_directory_urls, or serve build mode values.

Validation

  • uvx prek run -a
  • ./.venv/bin/python -m unittest mkdocs.tests.cli_tests
  • ./.venv/bin/python -m unittest mkdocs.tests.serve_tests.ServeTests

Notes

PLAN.md remains untracked locally and is not part of this PR.

@shenxianpeng shenxianpeng force-pushed the codex/click-upper-bound branch from 62d255c to 18e69c1 Compare April 29, 2026 21:47
@shenxianpeng shenxianpeng changed the title Pin Click below 8.3.0 Fix Click default option handling Apr 29, 2026
@shenxianpeng shenxianpeng added the bug Something isn't working label Apr 29, 2026
@shenxianpeng shenxianpeng force-pushed the codex/click-upper-bound branch from 3fabcaf to 18e69c1 Compare April 29, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live reload does not trigger automatically unless '--livereload' is explicitly passed

1 participant