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]

fix(ci): verify coverage uploads and normalize dependency inventories

Joshua Valluru21beb9b7b101
diff --git a/.github/workflows/test-dependency-installs.yml b/.github/workflows/test-dependency-installs.yml
index 0a72e302ea8..4ac014a9ddd 100644
--- a/.github/workflows/test-dependency-installs.yml
+++ b/.github/workflows/test-dependency-installs.yml
@@ -167,8 +167,9 @@ jobs:
with:
name: mcp-dependency-coverage
path: coverage-reports
- - uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
+ - uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
+ version: v11.3.1
use_oidc: true
directory: coverage-reports
flags: mcp-dependencies
diff --git a/tests/mcp_dependency_tests/check_environment.py b/tests/mcp_dependency_tests/check_environment.py
index bdd1145c4ed..e8327ee9905 100644
--- a/tests/mcp_dependency_tests/check_environment.py
+++ b/tests/mcp_dependency_tests/check_environment.py
@@ -1,3 +1,4 @@
+from collections.abc import Iterable
import importlib.metadata
import importlib.util
import json
@@ -9,15 +10,19 @@ from typing import Final
import unittest
+from packaging.utils import canonicalize_name
+
+
+def installed_versions(distributions: Iterable[importlib.metadata.Distribution]) -> dict[str, str]:
+ return {canonicalize_name(distribution.metadata["Name"]): distribution.version for distribution in distributions}
+
+
def main(profile: str, environment: Path) -> None:
import litellm
package: Final = Path(litellm.__file__).resolve()
assert package.is_relative_to(environment.resolve()), f"wrong wheel import: {package}"
- installed: Final = {
- distribution.metadata["Name"].lower().replace("_", "-"): distribution.version
- for distribution in importlib.metadata.distributions()
- }
+ installed: Final = installed_versions(importlib.metadata.distributions())
if profile == "core":
assert all(importlib.util.find_spec(name) is None for name in ("mcp", "mcp_types", "httpx2", "httpcore2"))
else:
diff --git a/tests/mcp_dependency_tests/test_runner.py b/tests/mcp_dependency_tests/test_runner.py
index 4c8e062d2ff..518a672013c 100644
--- a/tests/mcp_dependency_tests/test_runner.py
+++ b/tests/mcp_dependency_tests/test_runner.py
@@ -1,3 +1,4 @@
+import importlib.metadata
from pathlib import Path
import subprocess
import sys
@@ -6,7 +7,7 @@ import zipfile
import pytest
-from tests.mcp_dependency_tests import runner
+from tests.mcp_dependency_tests import check_environment, runner
def wheel(tmp_path: Path, name: str = "litellm") -> Path:
@@ -201,3 +202,13 @@ def test_proxy_rejects_missing_or_ambiguous_companions(tmp_path: Path, ambiguous
companion.unlink()
with pytest.raises(ValueError, match="exactly one enterprise"):
runner.project_text(path, "proxy")
+
+
[email protected]("name", ["Foo.Bar", "Foo__BAR", "foo--bar", "foo-bar"])
+def test_inventory_accepts_equivalent_distribution_names(tmp_path: Path, name: str) -> None:
+ metadata = tmp_path / "foo_bar-1.dist-info"
+ metadata.mkdir()
+ (metadata / "METADATA").write_text(f"Metadata-Version: 2.1\nName: {name}\nVersion: 1\n")
+ installed = check_environment.installed_versions(importlib.metadata.distributions(path=[str(tmp_path)]))
+ runner.verify_inventory("foo-bar==1\n", {"environment": {}, "installed": installed}, {})
+ assert installed == {"foo-bar": "1"}