From f05a9a2889f5763ae6504958e8153de0fae6f975 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 11 Nov 2026 17:43:21 +0100 Subject: [PATCH] fix: type the board choices for mypy --- scripts/common.py | 8 ++++---- scripts/profile_sync.py | 2 +- tests/test_launcher_placement.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/common.py b/scripts/common.py index 0765c3fe7..a2e9f2910 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -3472,10 +3472,10 @@ def offer_boards(config: dict) -> dict[tuple[str, str], frozenset[str] | None]: choices.append((row, every)) for key, spec in (row.get("board_defaults") or {}).items(): branch = str(key).replace("=", " ", 1) - choices.append((spec, admitted(lambda b, branch=branch: _branch_holds(branch, b)))) + choices.append((spec, admitted(functools.partial(_branch_holds, branch)))) for offer in offers: when = str(offer.get("when") or "") - choices.append((offer, admitted(lambda b, when=when: when_admits(when, b)) + choices.append((offer, admitted(functools.partial(when_admits, when)) if when else every)) for choice, boards in choices: if choice.get("core") and choice.get("emulator") in LIBRETRO_RUNNERS: @@ -3549,7 +3549,7 @@ def content_folder_tags(config: dict) -> set[str]: tags |= { CONTENT_FOLDER_PREFIX + json.dumps([ c, f, place(f), - None if target or boards.get((c, f)) is None else sorted(boards[(c, f)]), + None if target or (offered_on := boards.get((c, f))) is None else sorted(offered_on), ]) for c, f in pairs if f in folders } @@ -3754,7 +3754,7 @@ def content_layout( if f.get("unplaced") != OUTSIDE_BIOS_FOLDER: # A set a launcher record placed stays there: EmuDeck's # mame.ini rompath is read when Steam ROM Manager starts MAME - # with no -rompath (tools/launchers/mame.sh), and ES-DE's + # with no `-rompath` (tools/launchers/mame.sh), and ES-DE's # commands read the folders they pass. out.append(f) held = {(f.get("root") or "", f.get("standalone_path") or "")} diff --git a/scripts/profile_sync.py b/scripts/profile_sync.py index 4dde40c37..ef71dc549 100644 --- a/scripts/profile_sync.py +++ b/scripts/profile_sync.py @@ -3745,7 +3745,7 @@ def bump_commit( expected = dict(document) expected["source_commit"] = report.head new_text = _set_pin(text, document, "source_commit", report.head, "profiled_date") - if document.get("pin_follows"): + if document.get("pin_follows") and report.head: new_text, expected = _follow_config_reads(new_text, expected, document, report.head) if upstream_moves: expected["upstream_commit"] = report.upstream_head diff --git a/tests/test_launcher_placement.py b/tests/test_launcher_placement.py index d16942131..fba05cc0c 100644 --- a/tests/test_launcher_placement.py +++ b/tests/test_launcher_placement.py @@ -1210,7 +1210,7 @@ class EveryCoreAFolderOffers(unittest.TestCase): class CloneReadsItsParent(unittest.TestCase): - """ES-DE starts odyssey2 with -rompath on roms/odyssey2 alone, and MAME + """ES-DE starts odyssey2 with `-rompath` on roms/odyssey2 alone, and MAME finds o2bios.rom in the parent's videopac.zip (src/emu/driver.cpp:31-38).""" def test_the_parent_set_goes_to_the_clone_folder(self) -> None: