chore(lint): make the repository ruff-clean under the strict select

Clear the deferred full-repo lint backlog so the whole tree passes the strict
ruff select (E,W,F,I,B,UP,C4,SIM). Mechanical fixes dominate: import sorting,
pep585/604 annotations, dropped dead imports, and whitespace. The few semantic
changes are behavior-preserving: declare __all__ on the agent_utils and
alpha_vantage re-export hubs; expand 'from x import *' to explicit names; use
immutable tuple defaults instead of mutable list defaults; contextlib.suppress
for try/except/pass; and narrow an over-broad assertRaises.
This commit is contained in:
Yijia-Xiao committed 2026-06-14 16:38:36 +00:00
1 parent cbc5f67d42
commit e3bc872982
59 files changed
+315 -293

No files matched your search

+4 -3
View File
@@ -19,7 +19,8 @@ all three agents log the same warnings when fallback fires.
from __future__ import annotations
import logging
from typing import Any, Callable, Optional, TypeVar
from collections.abc import Callable
from typing import Any, TypeVar
from pydantic import BaseModel
@@ -28,7 +29,7 @@ logger = logging.getLogger(__name__)
T = TypeVar("T", bound=BaseModel)
def bind_structured(llm: Any, schema: type[T], agent_name: str) -> Optional[Any]:
def bind_structured(llm: Any, schema: type[T], agent_name: str) -> Any | None:
"""Return ``llm.with_structured_output(schema)`` or ``None`` if unsupported.
Logs a warning when the binding fails so the user understands the agent
@@ -46,7 +47,7 @@ def bind_structured(llm: Any, schema: type[T], agent_name: str) -> Optional[Any]
def invoke_structured_or_freetext(
structured_llm: Optional[Any],
structured_llm: Any | None,
plain_llm: Any,
prompt: Any,
render: Callable[[T], str],