Fix CI failures: lint, compile, addon structure, Windows install - #4
Merged
Conversation
Resolves all failing CI jobs in one pass so the pipeline can go green.
CI config:
- Compile Check: add `shell: bash` (default `sh -e` can't parse the
bash process substitution)
- Windows: switch to conda environment-file so mamba actually installs
Gramps + deps into `addons-ci` (the previous `mamba install` step
silently no-op'd). Adds a Verify step that prints `mamba list` and
imports the deps to fail fast if they aren't there.
Addon structure:
- Create po/template.pot stubs for AnniversariesGramplet, ArchiveAssist,
GrampsChat, GrampyScript — they had no po/ dir at all.
Lint (79 → 0 ruff errors across 29 files):
- Missing imports: WindowActiveError, ErrorDialog, DbTxn, EditDate,
ReportError, EventType, Surname, Any, display_help, reduce, time,
sys, Errors
- 3× `os.name is 'nt'` → `== 'nt'`; tuple-in-if bug in LifeLineChartView
- Removed dead code after `return` in AttachSourceTool; broken stub
line in SourceIndex/index.py
- Python 2 leftovers: `except E(msg)` → `except E as msg`,
`unicode()` → `str()`, removed `basestring`/`reload` branches
- Added `_` translation in MongoDB and libaccess; fixed broken lambda
missing `value` param in libaccess
- Renamed SurnameMappingGramplet.grp.py → .gpr.py (typo — file was
never loaded by Gramps, which only recognizes .gpr.py)
- Fixed `print(...).format(...)` missing close paren in QueryQuickview
- Dropped invalid `parent=self.uistate.window` at module level in
lxmlGramplet (no self exists outside instance methods)
- Fixed `displayer.display(...)` → `name_displayer.display(...)` in
QuiltView (matches the import alias)
- Initialized `tmg_dataset = None` in TMGimporter so ruff can prove
the `locals()` guard isn't needed
- Fixed `LOG.warn("ignored: " + data)` → `+ line` in JSONImport
(wrong var — would crash if it ever hit that branch)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Gramps is not published on conda-forge, so keep the binary deps (pygobject, gtk3) on conda and install gramps+orjson+pytest+dbf via pip. Move the env file out of .github/workflows/ so the IDE stops applying the GitHub Actions workflow schema to it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In-memory Gramps SQLite DB init hangs on Windows under the pip-installed Gramps + conda-forge GTK stack. Move the 99 DB-using TMG tests into test_integration_libtmg.py so the Windows unit job skips them via the existing --ignore-glob='**/test_integration*.py' filter. The 58 pure-logic tests (strip codes, date parsing, repo type / URL inference) stay in test_libtmg.py and run on both Linux and Windows. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Merge test_integration_libtmg.py into test_integration.py — shared helpers (_Rec, _table, _make_db, _add_person) are deduplicated at the top, and the E2E RELPH-pipeline class now sits alongside the 12 DB-backed function-level test classes (117 tests total). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
eduralph
added a commit
that referenced
this pull request
Jul 9, 2026
Addresses a second-pass adversarial review whose theme was that advisory buckets can hide real defects, plus a clearer failure message. Failure message (test_load_all_addon_modules): on failure, lead with only the real load failures (each with its error), then one plain-language line per advisory category explaining the cause and the fix. The full advisory lists stay in the warning log instead of burying the actionable failures under a wall of text. #1 Environment classifier is now specific and anchored. Dropped the over-broad signatures ("DISPLAY", bare "load_icon") that could match a genuine addon exception; kept anchored ones ("Gtk couldn't be initialized", "gtk-icon-theme-error-quark", the NoneType-load_icon phrase, missing-namespace) and only match them on a real error line, not an indented traceback frame or echoed source. Added TestEnvLoadClassifier with positive and negative cases. #2 A real import hang no longer passes as advisory. The isolated-load subprocess prints REGISTRY_READY after registration; on timeout, if the marker was emitted the addon's own import hung -> hard failure, otherwise the registry scan was slow -> advisory. (subprocess.TimeoutExpired captures partial stdout, so this needs no signals and works cross-platform.) #4 Opt-in strict mode for the depends_on load test. Environmentally inconclusive dependents stay advisory by default (headless local runs legitimately can't import GUI addons); setting GRAMPS_ADDON_TEST_STRICT=1 in a CI job with a full runtime promotes any unverified dependent to a failure. The i18n finding was again out of scope: test_i18n_extraction.py is pre-existing on maintenance/gramps60, not part of this PR. Verified against Gramps 6.0.8: classifier unit tests pass, the headless load test still passes with ClipboardGramplet kept advisory, hang-vs-slow-scan and strict-mode gating behave as intended. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves all failing CI jobs in one pass so the pipeline can go green.
CI config:
shell: bash(defaultsh -ecan't parse the bash process substitution)addons-ci(the previousmamba installstep silently no-op'd). Adds a Verify step that printsmamba listand imports the deps to fail fast if they aren't there.Addon structure:
Lint (79 → 0 ruff errors across 29 files):
os.name is 'nt'→== 'nt'; tuple-in-if bug in LifeLineChartViewreturnin AttachSourceTool; broken stub line in SourceIndex/index.pyexcept E(msg)→except E as msg,unicode()→str(), removedbasestring/reloadbranches_translation in MongoDB and libaccess; fixed broken lambda missingvalueparam in libaccessprint(...).format(...)missing close paren in QueryQuickviewparent=self.uistate.windowat module level in lxmlGramplet (no self exists outside instance methods)displayer.display(...)→name_displayer.display(...)in QuiltView (matches the import alias)tmg_dataset = Nonein TMGimporter so ruff can prove thelocals()guard isn't neededLOG.warn("ignored: " + data)→+ linein JSONImport (wrong var — would crash if it ever hit that branch)