Skip to content

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

Merged
benoit74 merged 4 commits into
openzim:mainfrom
Bojun-Vvibe:fix/openzim-python-scraperlib-272
May 26, 2026
Merged

fix(docs): rename mkdocstrings 'import' option to 'inventories'#298
benoit74 merged 4 commits into
openzim: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.
@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-272 branch from 4fea608 to 70d4dfe Compare May 26, 2026 14:13
@benoit74 benoit74 self-requested a review May 26, 2026 14:13
@benoit74 benoit74 marked this pull request as ready for review May 26, 2026 14:13
@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-272 branch from 70d4dfe to c718966 Compare May 26, 2026 14:15
@benoit74
Copy link
Copy Markdown
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

@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-272 branch from c718966 to 14413ca Compare May 26, 2026 14:17
@benoit74 benoit74 force-pushed the fix/openzim-python-scraperlib-272 branch from 14413ca to faa7627 Compare May 26, 2026 14:18
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (d6bd4b3) to head (f303f4d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74 benoit74 merged commit 8c85546 into openzim:main May 26, 2026
10 checks passed
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

2 participants