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
+5 -2
View File
@@ -67,7 +67,8 @@ def signature_for(mask: Iterable[str] = ()) -> type[dspy.Signature]:
continue
fields[name] = (str, dspy.InputField(desc=desc))
fields["findings"] = (list[Finding], dspy.OutputField(desc="JSON list; empty when the change is ordinary"))
return dspy.Signature(fields, BASELINE_INSTRUCTION)
signature: type[dspy.Signature] = dspy.Signature(fields, BASELINE_INSTRUCTION)
return signature
def numbered(lines: Sequence[str], start: int, end: int) -> str:
@@ -194,7 +195,9 @@ class _Loop(dspy.ReAct):
loop_parse_failed = False
def _call_with_potential_trajectory_truncation(self, module, trajectory, **input_args):
def _call_with_potential_trajectory_truncation(
self, module: dspy.Module, trajectory: dict[str, Any], **input_args: str
) -> dspy.Prediction:
try:
return super()._call_with_potential_trajectory_truncation(module, trajectory, **input_args)
except dspy.utils.exceptions.AdapterParseError as error: