fix(docs): rename mkdocstrings 'import' option to 'inventories'#298
Merged
benoit74 merged 4 commits intoMay 26, 2026
Merged
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.
4fea608 to
70d4dfe
Compare
70d4dfe to
c718966
Compare
Collaborator
|
@Bojun-Vvibe thank you, I'm adding a CI job to check we can build the doc in the CI and I will merge |
c718966 to
14413ca
Compare
14413ca to
faa7627
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
=======================================
Coverage 99.96% 99.96%
=======================================
Files 41 41
Lines 2542 2542
Branches 362 362
=======================================
Hits 2541 2541
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.