Fix Click default option handling#60
Open
shenxianpeng wants to merge 4 commits intomainfrom
Open
Conversation
62d255c to
18e69c1
Compare
3fabcaf to
18e69c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Noneso the config file can decide the final value. The CLI now checks Click's parameter source and restores default-sourced values for those options toNone, 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.ServeTestsNotes
PLAN.mdremains untracked locally and is not part of this PR.