Skip to content

Commit 5bed784

Browse files
committed
ci(image): install PyICU so gramps' webreport module is importable
The integration lane reported TimePedigreeHTML as a failed-to-load addon (NameError: name 'localAlphabeticIndex' is not defined). The defect is not in the addon: gramps 6.0's gramps/plugins/webreport/common.py sets HAVE_ICU = False try: from icu import Locale ... except ImportError: try: from PyICU import Locale ... except ImportError: pass # <- nothing imported at all and later does 'else: AlphabeticIndex = localAlphabeticIndex' — a name only bound on the inner fallback paths. With NEITHER icu nor PyICU installed the module raises NameError at import, so every addon importing it fails to load. The CI image had no PyICU (the logs were full of 'ICU not loaded ... Localization will be impaired'), so CI was reporting an addon defect that does not exist for real users, who normally have PyICU. Install PyICU (and libicu-dev to build it). This fixes the false addon failure, silences the localization warnings, and makes the image represent a realistic Gramps environment. The underlying gramps guard is still wrong and worth reporting upstream.
1 parent c206d1f commit 5bed784

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/docker/gramps-ci/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6767
pkg-config \
6868
python3-dev \
6969
libcairo2-dev \
70+
libicu-dev \
7071
intltool \
7172
gettext \
7273
git \
@@ -82,7 +83,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
8283
# ruff is PINNED: an unpinned ruff would change the lint verdict on rebuild (a
8384
# new rule in the E9/F63/F7/F82 selection flips a lane red — or silently stops
8485
# flagging — with no repo change). Bump deliberately, not by rebuild drift.
85-
RUN pip install --no-cache-dir PyGObject pycairo orjson ruff==0.15.22
86+
#
87+
# PyICU is REQUIRED, not optional. Gramps degrades localization without it
88+
# ("ICU not loaded ... Localization will be impaired"), and worse, gramps 6.0's
89+
# gramps/plugins/webreport/common.py cannot even be IMPORTED without it: when
90+
# neither `icu` nor `PyICU` resolves, its outer `except ImportError: pass`
91+
# leaves `localAlphabeticIndex` unbound and the module-level
92+
# `AlphabeticIndex = localAlphabeticIndex` raises NameError. Every addon that
93+
# imports that module (e.g. TimePedigreeHTML) then fails to load, so CI without
94+
# PyICU reports an addon defect that does not exist for real users. Installing
95+
# it also makes the image match a normal Gramps environment. (Built from source
96+
# against libicu-dev above.)
97+
RUN pip install --no-cache-dir PyGObject pycairo orjson PyICU ruff==0.15.22
8698

8799
# Install gramps: PyPI first, SHA-pinned git clone as fallback.
88100
RUN /bin/bash -eo pipefail <<'BASH'

0 commit comments

Comments
 (0)