CI: cherry-pick auto-derive addon requires_mod step from PR 820#14
Merged
Merged
Conversation
The Dockerfile bakes in only `dbf`, but addons declare a wider set of Python deps in their .gpr.py `requires_mod` lists (networkx, psycopg2, pygraphviz, lxml, svgwrite, boto3, litellm, life_line_chart, psycopg). Without these installed, per-addon unit tests and the plugin- registration subprocess load fail with ImportError/NameError. Add a pre-test step to unit-test-linux, unit-test-windows, and integration-test that globs every *.gpr.py, extracts the requires_mod union via ast.literal_eval, and pip-installs each package one at a time. Per-package install (not batched) keeps a single build failure (pygraphviz without graphviz-dev, psycopg2 without libpq-dev) from aborting the rest — the affected addon's tests will skip or fail in isolation without blocking others. Mirrors Gramps' Addon Manager install path (gramps/gui/plug/_windows.py __on_install_clicked → req.install → gen/utils/requirements.py), keeping .gpr.py files as the single source of truth for addon deps. New addon deps do not need a parallel update to the Dockerfile or this workflow.
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.
Summary
Cherry-picks
c6aa10e0fromfeature/ci-cd-pipeline-upstream(= upstream PR gramps-project#820) onto fork'smaintenance/gramps60. Adds an "Install addon runtime deps (derived fromrequires_mod)" pre-test step to all three job that exercises addon code:unit-test-linux,unit-test-windows,integration-test.This is the third of upstream PR gramps-project#820's five CI commits — the other two (
28febdcdshell:bash,715e71ddOS-split) landed via PR #12. This one wasn't picked at the time because integration-test wasn't running successfully end-to-end yet, so the missing addon deps weren't surfaced.Now that PR #13 brings in upstream's WebSearch fix (gramps-project#833) and the integration-test step actually exercises TMGimporter's
tests/test_integration.pyto completion, the missingdbfpackage surfaces:dbfis declared inTMGimporter.gpr.py'srequires_modlist. Without the auto-derive step, it's never installed.What the step does
For every
*/*.gpr.pyin the checkout, parses outrequires_mod = [...]literals viaast.literal_eval, takes the union, and pip-installs each package one at a time (per-package install so a single failing build — pygraphviz without graphviz-dev, etc. — doesn't abort the rest).Mirrors Gramps' Addon Manager install path (
gramps/gui/plug/_windows.py __on_install_clicked → req.install → gen/utils/requirements.py), keeping.gpr.pyfiles as the single source of truth for addon deps.Why fork-only
The same fix is already part of upstream PR gramps-project#820 as commit
c6aa10e0. Once gramps-project#820 lands upstream, a future fork-resync makes this cherry-pick redundant. No upstream PR needed for this.Verification
yaml.safe_load→ 7 jobs).dbf:maintenance/gramps60should clear the integration-test step'sNameError(dbfwill be on the path) and letTestFullPipelineRelphactually run.Stacking note
This PR is independent of #13 (the upstream-sync PR). They can land in either order; if #13 lands first, integration-test starts working as soon as this lands too. No coordination required.
🤖 Generated with Claude Code