fix(docs): rename mkdocstrings 'import' option to 'inventories'#298
Draft
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Draft
fix(docs): rename mkdocstrings 'import' option to 'inventories'#298Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Conversation
The mkdocstrings-python handler renamed its 'import' configuration key to 'inventories'. With the pinned mkdocstrings[python]==0.30.1, mkdocs build fails with 'PythonConfig.__init__() got an unexpected keyword argument import', breaking the Read the Docs publication.
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.
Closes #272
Repo
openzim/python-scraperlib
Issue
#272
Root cause
The Read the Docs build runs
hatch run docs:buildwhich invokesmkdocs build. Themkdocstrings-pythonhandler (pinned atmkdocstrings[python]==0.30.1) renamed its configuration keyimporttoinventories; the old name now raisesTypeError: PythonConfig.__init__() got an unexpected keyword argument 'import', causing every RTD build (including 5.3.0 publication) to fail.Fix
Renamed the
import:key underplugins.mkdocstrings.handlers.pythoninmkdocs.ymltoinventories:, keeping the same value (https://docs.python.org/3/objects.inv).Regression test
None added — the bug is purely in the static
mkdocs.ymlconfiguration; the project has no test suite for documentation config. Validation is viamkdocs buildsucceeding on Read the Docs (or locally inside thedocshatch env).Risk
trivial
Verification
skipped: full validation requires installing the docs hatch env (mkdocs + mkdocs-material + mkdocstrings + mkdocs-gen-files + literate-nav, etc.) which is heavy. Confirmed YAML still parses correctly via
python3 -c "import yaml; yaml.safe_load(open('mkdocs.yml'))". The error message in the RTD build log (unexpected keyword argument 'import') and the upstream mkdocstrings-python rename ofimport->inventoriesmake the fix unambiguous.