fix(types): resolve pyright errors introduced in #269 changes

- manifest.py: remove unused load_bottle_chain_from_dir import
- manifest_extends.py: drop redundant ManifestEgressRoute annotation
- test_cli_start_selector.py: remove unused call import
- test_cli_tui.py: move Optional/constants to top, annotate FakeScreen,
  remove unused curses import
- test_manifest_bottle_merge.py: add type args to dict, annotate **kwargs
This commit is contained in:
2026-06-25 07:08:57 +00:00
committed by codex
parent 6283542a7b
commit bb21c294b4
5 changed files with 15 additions and 17 deletions
+1 -1
View File
@@ -488,7 +488,7 @@ class ManifestIndex:
bottle = raw_bottle if merged == raw_bottle.git_user else replace(raw_bottle, git_user=merged)
return Manifest(agent=agent, bottle=bottle)
from .manifest_loader import load_bottle_chain_from_dir, scan_agent_names
from .manifest_loader import scan_agent_names
from .manifest_schema import validate_agent_frontmatter_keys
from .yaml_subset import YamlSubsetError, parse_frontmatter
+1 -1
View File
@@ -48,7 +48,7 @@ def _merge_two_bottles_runtime(base: "ManifestBottle", override: "ManifestBottle
for n in merged_repos_names
)
merged_routes: tuple[ManifestEgressRoute, ...] = base.egress.routes + override.egress.routes
merged_routes = base.egress.routes + override.egress.routes
merged_egress = ManifestEgressConfig(routes=merged_routes, Log=override.egress.Log)
return ManifestBottle(
+1 -1
View File
@@ -11,7 +11,7 @@ from __future__ import annotations
import os
import unittest
from unittest.mock import MagicMock, call, patch
from unittest.mock import MagicMock, patch
import bot_bottle.cli.start as start_mod
import bot_bottle.cli.tui as tui_mod
+10 -12
View File
@@ -8,9 +8,13 @@ a real curses session (which requires a TTY).
from __future__ import annotations
import unittest
from typing import Any, Optional
from bot_bottle.cli.tui import _filter_items, _multiselect_loop, filter_multiselect, filter_select
_KEY_ESC = 27
_KEY_CTRL_D = 4
class TestFilterItems(unittest.TestCase):
def setUp(self):
@@ -68,18 +72,15 @@ class TestMultiselectLoopReordering(unittest.TestCase):
def _run(self, keys: list[int], items: list[str], initial: list[str]) -> Optional[list[str]]:
"""Run _multiselect_loop with a synthetic screen feeding `keys`."""
import curses as _curses
key_iter = iter(keys)
class FakeScreen:
def erase(self): pass
def getmaxyx(self): return (40, 80)
def refresh(self): pass
def getch(self):
return next(key_iter)
def addstr(self, *a, **kw): pass
def keypad(self, *a): pass
def erase(self) -> None: pass
def getmaxyx(self) -> tuple[int, int]: return (40, 80)
def refresh(self) -> None: pass
def getch(self) -> int: return next(key_iter)
def addstr(self, *a: Any) -> None: pass
def keypad(self, *a: Any) -> None: pass
return _multiselect_loop(FakeScreen(), items, title="", initial=initial) # type: ignore[arg-type]
@@ -144,9 +145,6 @@ class TestMultiselectLoopReordering(unittest.TestCase):
self.assertEqual(["a", "b"], result)
from typing import Optional
_KEY_ESC = 27
_KEY_CTRL_D = 4
if __name__ == "__main__":
+2 -2
View File
@@ -17,11 +17,11 @@ from bot_bottle.manifest import ManifestBottle, ManifestError, ManifestIndex
from bot_bottle.manifest_extends import merge_bottles_runtime
def _index(bottles: dict, agents: dict) -> ManifestIndex:
def _index(bottles: dict[str, object], agents: dict[str, object]) -> ManifestIndex:
return ManifestIndex.from_json_obj({"bottles": bottles, "agents": agents})
def _bottle(**kwargs) -> ManifestBottle:
def _bottle(**kwargs: object) -> ManifestBottle:
return ManifestBottle.from_dict("test", kwargs)