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 8e13cab1..3fb8607b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,14 @@ 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) + +### 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 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