Skip to content

Commit 7941194

Browse files
eduralphclaude
andcommitted
Fix CI failures: lint, compile, addon structure, Windows install
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>
1 parent 2fb28b6 commit 7941194

38 files changed

Lines changed: 137 additions & 43 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
- uses: actions/checkout@v4
7171

7272
- name: Compile all Python files (excluding .gpr.py)
73+
shell: bash
7374
run: |
7475
failed=0
7576
while IFS= read -r f; do
@@ -126,12 +127,15 @@ jobs:
126127
uses: conda-incubator/setup-miniconda@v3
127128
with:
128129
miniforge-version: latest
129-
python-version: "3.12"
130130
activate-environment: addons-ci
131-
channels: conda-forge
131+
environment-file: .github/workflows/environment.yml
132+
use-mamba: true
132133

133-
- name: Install Gramps + test deps
134-
run: mamba install -y "gramps>=6.0,<6.1" pygobject gtk3 orjson pytest dbf
134+
- name: Verify environment
135+
run: |
136+
mamba info
137+
mamba list | head -30
138+
python -c "import pytest, gramps, gi; print('deps OK')"
135139
136140
- name: Run per-addon unit tests
137141
env:

.github/workflows/environment.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: addons-ci
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
- gramps>=6.0,<6.1
7+
- pygobject
8+
- gtk3
9+
- orjson
10+
- pytest
11+
- dbf

AnniversariesGramplet/AnniversariesGramplet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from gramps.gen.utils.db import get_participant_from_event
2727
from gramps.gen.datehandler import get_date
2828
from gramps.gen.config import config
29+
from gramps.gen.errors import WindowActiveError
2930
from gramps.gui.editors import EditEvent
3031

3132
from gramps.gen.const import GRAMPS_LOCALE as glocale
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2026-04-17 00:00+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"

ArchiveAssist/po/template.pot

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the PACKAGE package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: PACKAGE VERSION\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2026-04-17 00:00+0000\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <LL@li.org>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: 8bit\n"

AttachSourceTool/AttachSourceTool.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,3 @@ def create_source(self, source_text):
209209
self.db.add_source(source, self.trans)
210210
return source
211211

212-
self.db.add_event(event, self.trans)
213-
return event
214-

CombinedView/combinedview.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
from personpage import PersonPage
5555
from eventpage import EventPage
5656
from gramps.gen.config import config
57-
from gramps.gen.lib import Family, ChildRef, Person
57+
from gramps.gen.lib import Family, ChildRef, Person, EventType
58+
from gramps.gen.utils.db import get_birth_or_fallback, get_death_or_fallback
59+
from gramps.gen.datehandler import get_date
5860
from gramps.gui.uimanager import ActionGroup
5961
from gramps.gui.selectors import SelectorFactory
6062
from gramps.gen.errors import WindowActiveError

DenominoViso/DenominoViso.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
from urllib.request import pathname2url
130130
from xml.sax.saxutils import escape, quoteattr
131131
from math import sin,cos,exp,sqrt,e,pi
132+
from functools import reduce
132133
import codecs
133134

134135
#-------------------------------------------------------------------------

DescendantBooks/RunReport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from gramps.gen.plug.report import CATEGORY_TEXT
3939
from gramps.gui.utils import open_file_with_default_application
4040
from gramps.gui.user import User
41+
from gramps.gui.dialog import ErrorDialog
4142
from gramps.gui.plug.report._textreportdialog import TextReportDialog
4243

4344

DescendantsLines/ft.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import xml.dom.minidom
3232
import getopt
3333
import sys
34+
from functools import reduce
3435
#-------------------------------------------------------------------------
3536
#
3637
# variables

0 commit comments

Comments
 (0)