Skip to content

fix(docs): rename mkdocstrings 'import' option to 'inventories'#298

Draft
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-272
Draft

fix(docs): rename mkdocstrings 'import' option to 'inventories'#298
Bojun-Vvibe wants to merge 1 commit intoopenzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-272

Conversation

@Bojun-Vvibe
Copy link
Copy Markdown

Closes #272

Repo

openzim/python-scraperlib

Issue

#272

Root cause

The Read the Docs build runs hatch run docs:build which invokes mkdocs build. The mkdocstrings-python handler (pinned at mkdocstrings[python]==0.30.1) renamed its configuration key import to inventories; the old name now raises TypeError: PythonConfig.__init__() got an unexpected keyword argument 'import', causing every RTD build (including 5.3.0 publication) to fail.

Fix

Renamed the import: key under plugins.mkdocstrings.handlers.python in mkdocs.yml to inventories:, keeping the same value (https://docs.python.org/3/objects.inv).

Regression test

None added — the bug is purely in the static mkdocs.yml configuration; the project has no test suite for documentation config. Validation is via mkdocs build succeeding on Read the Docs (or locally inside the docs hatch 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 of import -> inventories make the fix unambiguous.

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.
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.

Publishing 5.3.0 on readthedocs.org is broken

1 participant