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]

test_package_dependencies

Ishaan Jaffer0429ca4fd0ba
diff --git a/tests/local_testing/test_basic_python_version.py b/tests/local_testing/test_basic_python_version.py
index ab177262505..e25f46ec1ba 100644
--- a/tests/local_testing/test_basic_python_version.py
+++ b/tests/local_testing/test_basic_python_version.py
@@ -38,10 +38,21 @@ def test_litellm_proxy_server():
def test_package_dependencies():
+ """
+ Test that all optional dependencies are correctly specified in extras.
+ """
try:
- import tomli
import pathlib
import litellm
+
+ # Try to import tomllib (Python 3.11+) or tomli (older versions)
+ try:
+ import tomllib as tomli
+ except ImportError:
+ try:
+ import tomli
+ except ImportError:
+ pytest.skip("tomli/tomllib not available - skipping dependency check")
# Get the litellm package root path
litellm_path = pathlib.Path(litellm.__file__).parent.parent