litellm/litellm/rag
Mateo Wang 3ccc619792
fix(router): make the constructor stub work for mypy and guard it in CI (#50354)
* fix(router): make the constructor stub work for mypy and guard it in CI

Use a plain ParamSpec so mypy reads the stub, drop the dead _host parameter
the Rust core already refused, type check a valid and an unknown argument in
tests/e2e_harness, and run that type check when litellm Python files change.

* fix(typing): read type variables as type variables in mypy and guard the Router stub in lint

* fix(typing): count only the probe errors in the Router stub guard and flag Final type variables everywhere

* fix(lint): run the Router stub guard and e2e type check from make check

make check now runs check_router_constructor_stub.py when litellm/router.py
or uv.lock changes, and the e2e basedpyright step on pyproject.toml, uv.lock,
pyrightconfig.json, and litellm-proxy-extras Python, matching CI. CI's e2e
type check also fires on litellm-proxy-extras Python, which tests/e2e/perf
imports. LIT010 treats TypeAliasType like a type variable, since mypy also
rejects a Final type alias.

* fix(lint): guard the Router stub through the litellm export and keep TypeAliasType bare in LIT010 docs

* test: type the new LIT010 type variable tests
2026-11-22 21:25:00 +00:00
..
ingestion refactor(typing): clear 1146 basedpyright Any errors across 365 files (#52768) 2026-11-21 04:25:33 +00:00
text_splitters feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
__init__.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
main.py refactor(typing): clear 1146 basedpyright Any errors across 365 files (#52768) 2026-11-21 04:25:33 +00:00
rag_query.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
utils.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00