fix(types): mypy clean again over src; stub-less libraries and the benchmark imports handled in pyproject

66 errors had accumulated in src since the last green run (the hunt modules of groups 4-6, stats, candidates,
runner). Codex typed them without behaviour change; the 17 inline import-untyped ignores it added are replaced by
one override for dspy, pandas, statsmodels and scikit-learn, and the hunt package's lazy imports of benchmarks/
(never type-checked, not in files) are followed silently so src stays strict against their signatures.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-14 03:03:12 +02:00
co-authored by Claude Fable 5.1
parent 0d7d3f0dc9
commit c8f7610313
17 changed files with 78 additions and 36 deletions
+3 -2
View File
@@ -20,7 +20,7 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import TYPE_CHECKING, Literal
from ..source import canonical_language
from ..source import FunctionRange, canonical_language
if TYPE_CHECKING:
from .taxonomy import FamilyTaxonomy
@@ -368,7 +368,7 @@ def labeled_family(case: object, taxonomy: FamilyTaxonomy | None = None) -> str:
def labeled_spans(
case: object, ranges: Mapping[str, Sequence[tuple[str, int, int]]], *, function: str = ""
case: object, ranges: Mapping[str, Sequence[tuple[str, int, int] | FunctionRange]], *, function: str = ""
) -> tuple[tuple[str, int, int], ...]:
"""The (path, start, end) spans of the labeled functions; ``function`` overrides the label for the fixed side.
@@ -378,6 +378,7 @@ def labeled_spans(
wanted = {function} if function else {str(getattr(row, "function", "") or "") for row in getattr(case, "expected", ()) or ()}
wanted.discard("")
found: list[tuple[str, int, int]] = []
_kind: list[str]
for path, entries in ranges.items():
for name, start, end, *_kind in entries:
if name in wanted: