Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_ruff_dead_test_code

ryan-crabbe-berri7d5a2c1a0db4
diff --cc ruff-tests.toml
index 8f21ca31a6f,e52e1a96d00..7d28d6d838a
--- a/ruff-tests.toml
+++ b/ruff-tests.toml
@@@ -36,17 -36,10 +36,21 @@@
# `re.search`, so a `.` copied out of an error message is a wildcard and the block
# accepts messages the author never meant to accept. Mark a real regex raw, wrap a
# literal message in `re.escape`, and the pattern says which one it is
+ # F823 a module-level name read inside a function that also binds it lower down. The
+ # later binding makes the name local for the whole body, so the read raises
+ # UnboundLocalError, and in an autouse fixture that takes every test in the
+ # directory down with it
+# F601 the same key literal twice in one dict. Python keeps the last value, so the
+# first is dropped before the test ever runs, and a fixture that looks like it
+# covers two cases covers one
+# B023 a closure over a loop variable. Every closure sees the last iteration's value,
+# so a per-case callback built in a loop checks the last case N times. Bind the
+# value as a parameter instead
+# B025 an `except` for a type an earlier `except` already catches. The second handler
+# is unreachable, so the recovery or skip written there never happens
+# F632 `is` against a literal. It compares identity, so it passes only where CPython
+# happens to intern the value and stops meaning what it says the moment the
+# value is built at runtime
#
# No target-version here on purpose: it resolves from requires-python (>=3.10), so
# 3.11-only builtins like BaseExceptionGroup are correctly flagged in a tree that
@@@ -69,8 -62,5 +73,9 @@@ lint.select =
"PLR0133",
"PLW0127",
"RUF043",
+ "F823",
+ "F601",
+ "B023",
+ "B025",
+ "F632",
]
diff --cc tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py
index 98af1fb7ce2,375c0d2640c..ef560bd1b7d
--- a/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py
+++ b/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py
@@@ -7,11 -5,7 +5,8 @@@ import orjso
import pytest
from fastapi import Request
from fastapi.testclient import TestClient
+from starlette.datastructures import FormData
- sys.path.insert(
- 0, os.path.abspath("../../../..")
- ) # Adds the parent directory to the system path
import litellm
diff --cc tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py
index 88141fd1c90,ac140abe31f..97b77ec95e0
--- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py
+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py
@@@ -13,11 -12,7 +12,8 @@@ import http
import pytest
from fastapi import HTTPException, Request, Response
from fastapi.testclient import TestClient
+from starlette.datastructures import FormData
- sys.path.insert(
- 0, os.path.abspath("../../../..")
- ) # Adds the parent directory to the system path
import litellm
from litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (