Skip to content

Fix Click 8.3 serve livereload default#4143

Open
marko1olo wants to merge 1 commit into
mkdocs:masterfrom
marko1olo:fix-serve-click-path-watching
Open

Fix Click 8.3 serve livereload default#4143
marko1olo wants to merge 1 commit into
mkdocs:masterfrom
marko1olo:fix-serve-click-path-watching

Conversation

@marko1olo
Copy link
Copy Markdown

Fixes #4032.
Refs #4014.

Summary

  • replace the separate --livereload / --no-livereload flag_value options with Click's paired boolean option form
  • keep mkdocs serve defaulting to livereload=True on Click 8.3.0, so watch paths are registered again
  • exclude Click 8.2.2 because that yanked release still corrupts several MkDocs CLI defaults (build_type, strict, use_directory_urls), not just livereload

Verification

  • red before the CLI flag change, with Click 8.3.0: CLITests.test_serve_default passed livereload=False into mkdocs.commands.serve.serve
  • C:\hades\oss\.venvs\mkdocs-4032-click830\Scripts\python.exe -m unittest mkdocs.tests.cli_tests with Click 8.3.0: 37 passed
  • C:\hades\oss\.venvs\mkdocs-4045\Scripts\python.exe -m unittest mkdocs.tests.cli_tests with Click 8.4.1: 37 passed
  • C:\hades\oss\.venvs\mkdocs-4045\Scripts\python.exe -m black --check --diff --target-version py313 mkdocs\__main__.py: passed
  • C:\hades\oss\.venvs\mkdocs-4045\Scripts\isort.exe --check-only --diff mkdocs\__main__.py: passed
  • git diff --check: passed

Note: ruff check mkdocs\__main__.py reports pre-existing lazy-import/style findings in this file that are outside this patch; ruff check --diff mkdocs\__main__.py reports no fixable diff.

@marko1olo
Copy link
Copy Markdown
Author

CI note: the current test failures I inspected are the existing BuildTests.test_draft_docs_with_comments_from_user_guide failures, not this CLI change.

Representative failed jobs:

  • test (3.12, ubuntu-latest): fails because other_unpublished.html exists and the expected draft-docs preview log is missing.
  • test (3.10, windows-latest): same BuildTests.test_draft_docs_with_comments_from_user_guide failure.

The PR-specific checks are green for lint/style/build/package, and the local Click-focused CLI regression passes on both Click 8.3.0 and Click 8.4.1 as listed in the PR description.

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.

mkdocs does not watch for file changes when using click>8.2.1

1 participant