mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
ruff.toml has excluded litellm/types/* since 2024, so no lint rule ever ran on the types tree. Remove the exclusion, apply ruff --fix and ruff format across litellm/types, and hand-fix what autofix cannot reach so the pyupgrade budgets stay at zero: implicit type aliases converted to PEP 604 unions, RootModel[Union[...]] bases, duplicate imports, and a stray print. Load-bearing import X as X re-exports deleted by preview-mode F401 are restored, and the six star-imported hub modules keep their re-export surface via per-file F401 ignores. Star-import consumers that silently relied on typing names leaking from those hubs are modernized to builtin generics and PEP 604 unions. Runtime annotation introspection that only recognized typing.Union is taught types.UnionType (guardrail UI field schemas, volcengine response fill), with regression tests for both. Strict budget limits for the rules the types tree now trips are raised to exact measured totals, so any net-new violation still fails the gate |
||
|---|---|---|
| .. | ||
| embedding | ||
| responses | ||
| __init__.py | ||
| test_volcengine.py | ||
| test_volcengine_embedding.py | ||