From 18b00496c3e16899af62ca5800d25487d0e767e9 Mon Sep 17 00:00:00 2001 From: Thomas-Otavio Peulen Date: Mon, 20 Jul 2026 13:31:42 +0200 Subject: [PATCH] ci(docs-backfill): inject __version__ for old tttrlib Old tttrlib (0.24.x/0.25.x) does not expose __version__, which the old conf.py reads unguarded and crashes on (AttributeError -> ConfigError). Inject __version__ (= the version being built) into the installed module when missing. --- .github/workflows/docs-backfill.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docs-backfill.yml b/.github/workflows/docs-backfill.yml index 86671940..326c910a 100644 --- a/.github/workflows/docs-backfill.yml +++ b/.github/workflows/docs-backfill.yml @@ -109,6 +109,13 @@ jobs: # Build + install this tag's package so autodoc + the version label # match the version being built. python -m pip install ".[examples]" || python -m pip install . + # Old tttrlib does not expose __version__, which the old conf.py + # reads unguarded (AttributeError). Inject it (value = the version + # being built) so conf.py's version detection works. + TTTR_FILE=$(python -c "import tttrlib; print(tttrlib.__file__)" 2>/dev/null || true) + if [ -n "${TTTR_FILE}" ] && ! python -c "import tttrlib,sys; sys.exit(0 if hasattr(tttrlib,'__version__') else 1)" 2>/dev/null; then + printf "\n__version__ = '%s'\n" "${dest}" >> "${TTTR_FILE}" + fi # Pre-tiered conf.py does not exclude the gallery-generated # notebooks, which collide with the generated .rst ("multiple files # found"). Add the exclusion the tiered conf.py already carries.