fix: pin mkdocs<2.0 and mkdocs-material<10, add NO_MKDOCS_2_WARNING t…#2132
Open
Acuspeedster wants to merge 1 commit into
Open
fix: pin mkdocs<2.0 and mkdocs-material<10, add NO_MKDOCS_2_WARNING t…#2132Acuspeedster wants to merge 1 commit into
Acuspeedster wants to merge 1 commit into
Conversation
…o all CI doc steps Signed-off-by: Acuspeedster <arnavrajsingh@gmail.com>
0e0e619 to
7f2769b
Compare
This was referenced Mar 10, 2026
Contributor
Author
Contributor
|
This pull request has been automatically marked as stale because it has not had activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. |
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.
PR: Pin MkDocs below 2.0 and suppress deprecation warnings in all CI doc steps
Branch:
fix/pin-mkdocs-below-2-pin-materialFixes: #2104 Upgrade trestle to use MkDocs 2.0
Related open PR: #2131
Problem
MkDocs 2.0 was released but the MkDocs plugin ecosystem most critically Material for MkDocs (the theme driving this project's documentation) has not yet migrated to support it. Installing MkDocs 2.0 breaks the docs build entirely. Additionally, MkDocs 1.x now emits a
FutureWarningabout the upcoming 2.0 release during every build, which can surface as noise in CI output.Without an explicit upper-bound pin on
mkdocs,pipis free to resolvemkdocs>=1.6.0tomkdocs 2.0.x, causing docs builds to silently break for any new contributor or in any clean CI environment.What existing PR #2131 did (and missed)
PR #2131 by @Aditya-Aryan-6914 was a step in the right direction but has two significant gaps:
Gap 1:
mkdocs-materialleft unpinned#2131 pinned
mkdocs>=1.6.0,<2.0.0but leftmkdocs-materialcompletely unconstrained:The Material for MkDocs package will eventually release a version requiring MkDocs ≥ 2.0.0. When that happens,
pipresolvingmkdocs-materialto the newest release would pull in MkDocs 2.0 as a transitive dependency, silently defeating the<2.0.0pin onmkdocsitself. Themkdocs-materialpin is just as critical as themkdocspin.Gap 2:
Check if dirty (mkdocs)step not covered#2131 added
NO_MKDOCS_2_WARNING: 1to theValidate website content (mkdocs)step inpython-test.ymlbut missed the very next step,Check if dirty (mkdocs), in the same file. That step runsmake check-for-changes, which internally callshatch run docs:automationandhatch run docs:buildboth of which invokemkdocs buildand therefore emit the deprecation warning.What this PR does
1. Pins
mkdocsANDmkdocs-materialinpyproject.tomlmkdocs<2.0.0prevents pip from resolving the package to MkDocs 2.x until the full plugin ecosystem is MkDocs-2.0-ready.mkdocs-material>=9.0.0,<10.0.0keeps Material pinned to the MkDocs-1.x-compatible 9.x series. Material v9.x is the current stable release line and is fully tested with MkDocs 1.5/1.6. Setting<10.0.0ensures a future Material 10 release (which is expected to target MkDocs 2.0) does not get installed and pull in MkDocs 2.x as a transitive dependency.2. Adds
NO_MKDOCS_2_WARNING: '1'to all four mkdocs-invoking CI stepspython-test.ymlValidate website content (mkdocs)python-test.ymlCheck if dirty (mkdocs)python-push.ymlValidate website content (mkdocs)docs-update.ymlCreate release(mike deploy → mkdocs build)The env var is set at the step level (not job level) so it is scoped precisely:
Files changed
pyproject.tomlmkdocs>=1.6.0,<2.0.0; pinmkdocs-material>=9.0.0,<10.0.0.github/workflows/python-test.ymlNO_MKDOCS_2_WARNING: '1'toValidate website contentandCheck if dirtysteps (Check if dirty is new not in #2131).github/workflows/python-push.ymlNO_MKDOCS_2_WARNING: '1'toValidate website contentstep.github/workflows/docs-update.ymlNO_MKDOCS_2_WARNING: '1'toCreate releasestepTesting
test,bdist, anddeploy-docswill validate the build against the pinned dependency set.NO_MKDOCS_2_WARNINGguard can be removed.Checklist
mkdocs<2.0.0to prevent accidental MkDocs 2.0 installationmkdocs-material<10.0.0to close the transitive-dependency loopholefix: pin mkdocs<2.0 and mkdocs-material<10, add NO_MKDOCS_2_WARNING to all CI doc stepscloses Upgrade trestle to use MkDocs 2.0 #2104