From d7ea479f7f95f3e94c02163695daf11c2520fb30 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Thu, 22 Oct 2026 11:37:52 +0000 Subject: [PATCH 1/2] Fix documentation build mkdocstrings-python 2.x renamed the handler's `import` key to `inventories` and moved `load_external_modules` out of `options` to the top level, breaking `mkdocs build` with: TypeError: PythonConfig.__init__() got an unexpected keyword argument 'import' Also update the CI badge in README.md: it referenced the old "test" workflow name, which was renamed to "Tests", causing the privacy plugin to fail downloading it (404) and crash the build. --- CHANGELOG.md | 4 ++++ README.md | 2 +- mkdocs.yml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e13cab1..1f8bc078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Breaking**: `Creator.add_metadata` no longer auto-converts a `Date` metadata value passed as `datetime.date`/`datetime.datetime`; pass pre-formatted `str`/`bytes` instead (#188) +### Fixed + +- Fix documentation build broken by mkdocstrings-python `import`/`load_external_modules` config changes and a stale CI badge URL (#279) + ## [3.13.1] - 2026-10-05 ### Changed diff --git a/README.md b/README.md index f8ebebdc..d072cdaa 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ interface on top of the [C++ `libzim` library](https://github.com/openzim/libzim It is primarily used in [openZIM](https://github.com/openzim/) scrapers like [`sotoki`](https://github.com/openzim/sotoki) or [`youtube2zim`](https://github.com/openzim/youtube). -[![Build Status](https://github.com/openzim/python-libzim/workflows/test/badge.svg?query=branch%3Amain)](https://github.com/openzim/python-libzim/actions?query=branch%3Amain) +[![Build Status](https://github.com/openzim/python-libzim/actions/workflows/Tests.yaml/badge.svg?branch=main)](https://github.com/openzim/python-libzim/actions/workflows/Tests.yaml?query=branch%3Amain) [![CodeFactor](https://www.codefactor.io/repository/github/openzim/python-libzim/badge)](https://www.codefactor.io/repository/github/openzim/python-libzim) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![PyPI version shields.io](https://img.shields.io/pypi/v/libzim.svg)](https://pypi.org/project/libzim/) diff --git a/mkdocs.yml b/mkdocs.yml index 4de3f8a4..28e1dded 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -83,13 +83,13 @@ plugins: handlers: python: # Set up cross-references to Python types - import: + inventories: - url: https://docs.python.org/3/objects.inv domains: [std, py] - https://typing-extensions.readthedocs.io/en/latest/objects.inv + load_external_modules: false options: heading_level: 2 - load_external_modules: false show_submodules: false # force dynamic analysis from compiled module when loading data allow_inspection: true From 416b3c47ce300709d221f8c0ab1215df01f6ee83 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Thu, 22 Oct 2026 11:41:12 +0000 Subject: [PATCH 2/2] Add CI job to build documentation Mirrors the build-docs job from python-scraperlib: builds the native extension then runs mkdocs via hatch, so a broken docs build fails CI instead of only being noticed on Read the Docs. --- .github/workflows/Tests.yaml | 29 +++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 56c8ee4d..9807a33f 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -48,3 +48,32 @@ jobs: with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} + + build-docs: # validate that doc can be built + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v7 + + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.13" + + - name: Install dependencies + run: | + pip install -U pip hatch + + - name: Build native extension + run: hatch run build-ext + + - name: Build mkdocs documentation + run: hatch run docs:build + + - name: Save doc artifact + uses: actions/upload-artifact@v7 + with: + path: | + site/ + name: doc + retention-days: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8bc078..3fb8607b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix documentation build broken by mkdocstrings-python `import`/`load_external_modules` config changes and a stale CI badge URL (#279) +### Added + +- Add a CI job building the documentation on every PR/push so this kind of breakage is caught automatically (#279) + ## [3.13.1] - 2026-10-05 ### Changed