From d5891c7681ddd403945e3104dc90f0a672f3c66b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 18:32:47 +0000 Subject: [PATCH 1/3] ci(docs): build the documentation in the official GDAL image Run the docs job in ghcr.io/osgeo/gdal:ubuntu-small-3.11.0, the same image as the root Dockerfile, so libgdal and the osgeo Python bindings are already installed and version-matched. This removes the ubuntugis PPA, the apt GDAL packages, setup-python and the compilation of the GDAL wheel. Python tooling and Tk are installed with apt, and a virtual environment created with --system-site-packages exposes the image's osgeo bindings to the project. AI-Level: 7 AI-Model: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CUNZAXTg3vthj5KZYCgf3m --- .github/workflows/docs_builder.yml | 38 +++++++++++------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docs_builder.yml b/.github/workflows/docs_builder.yml index fcc8c4e3..1cc7d2f5 100644 --- a/.github/workflows/docs_builder.yml +++ b/.github/workflows/docs_builder.yml @@ -32,13 +32,14 @@ concurrency: group: "pages" cancel-in-progress: true -env: - GDAL_VERSION: 3.* - PYTHON_VERSION: "3.11" - jobs: build-docs: runs-on: ubuntu-24.04 + # official GDAL image: libgdal and its Python bindings are already installed and + # version-matched, so no apt/PPA step and no GDAL compilation. + # Keep the tag aligned with GDAL_VERSION in the root Dockerfile. + container: + image: ghcr.io/osgeo/gdal:ubuntu-small-3.11.0 steps: - name: Get source code @@ -46,31 +47,20 @@ jobs: with: persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v7 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: "pip" - cache-dependency-path: pyproject.toml - - - name: Install GDAL binaries + - name: Install Python tooling and Tk run: | - sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt-get update - sudo apt install gdal-bin=${{ env.GDAL_VERSION }} - sudo apt install libgdal-dev=${{ env.GDAL_VERSION }} - export CPLUS_INCLUDE_PATH=/usr/include/gdal - export C_INCLUDE_PATH=/usr/include/gdal + apt-get update + apt-get install -y --no-install-recommends python3-pip python3-venv python3-tk gdal-config --version - - name: Install complementary tools + # --system-site-packages lets the venv see the image's pre-built osgeo bindings + - name: Create virtual environment run: | - sudo apt install python3-tk + python3 -m venv --system-site-packages /opt/venv + echo "/opt/venv/bin" >> "$GITHUB_PATH" - - name: Install project requirements - run: | - python -m pip install -U pip setuptools wheel - # Install GDAL first - python -m pip install GDAL=="`gdal-config --version`.*" + - name: Upgrade packaging tools + run: python -m pip install -U pip setuptools wheel # this job must run before installing other dependencies to avoid listing everything - name: Generates dependencies graph page with pipdetree From 6daebd3a202f79775504713445d64c75d000d82c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 19:21:08 +0000 Subject: [PATCH 2/3] ci(docs): install the gui extra and Qt system libraries to document dicogis.ui The documentation build did not install PyQt6, so autodoc failed to import the 14 GUI and qt_compat modules and their API pages were empty. Install the gui extra and the system libraries PyQt6 needs to be imported in the GDAL image. AI-Level: 7 AI-Model: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CUNZAXTg3vthj5KZYCgf3m --- .github/workflows/docs_builder.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs_builder.yml b/.github/workflows/docs_builder.yml index 1cc7d2f5..d4843aad 100644 --- a/.github/workflows/docs_builder.yml +++ b/.github/workflows/docs_builder.yml @@ -47,10 +47,11 @@ jobs: with: persist-credentials: false - - name: Install Python tooling and Tk + # the libraries after python3-tk are the system ones PyQt6 needs to be imported (GUI modules documented by autodoc) + - name: Install Python tooling, Tk and Qt system libraries run: | apt-get update - apt-get install -y --no-install-recommends python3-pip python3-venv python3-tk + apt-get install -y --no-install-recommends python3-pip python3-venv python3-tk libgl1 libegl1 libxkbcommon0 libdbus-1-3 libglib2.0-0t64 gdal-config --version # --system-site-packages lets the venv see the image's pre-built osgeo bindings @@ -77,7 +78,8 @@ jobs: pip-licenses --format=markdown --with-authors --with-description --with-urls --ignore-packages dicogis --output-file=docs/misc/licenses.md - name: Install project as a package - run: python -m pip install .[doc] + # gui extra: PyQt6 must be importable so autodoc can document dicogis.ui + run: python -m pip install .[doc,gui] - name: Build doc using Sphinx run: sphinx-build -b html -d docs/_build/cache -j auto -q docs docs/_build/html From e31301b74ddb050d18d7a5a683cf3996088283d6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 19:21:08 +0000 Subject: [PATCH 3/3] docs(development): install the gui extra to build the documentation The API pages of dicogis.ui need PyQt6 to be importable, as in the CI workflow. AI-Level: 7 AI-Model: Claude Sonnet 5.5 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CUNZAXTg3vthj5KZYCgf3m --- docs/development/documentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/development/documentation.md b/docs/development/documentation.md index c7ede5c2..f9e8193e 100644 --- a/docs/development/documentation.md +++ b/docs/development/documentation.md @@ -7,8 +7,8 @@ Project uses Sphinx to generate documentation from docstrings (documentation in- To build it: ```sh -# install aditionnal dependencies -python -m pip install .[doc] +# install aditionnal dependencies (gui: PyQt6, needed to document dicogis.ui) +python -m pip install .[doc,gui] # build it sphinx-build -b html docs docs/_build/html # optimized (quiet, multiprocessing, doctrees separated)