[Fix] CI: fix 6 more CircleCI job failures from uv migration
1. check_code_and_doc_quality: add PLR0915 ignore for sandbox_executor.py
2. auth_ui_unit_tests: add prisma generate step (entrypoint.sh only runs
migration, not client generation)
3. proxy_store_model_in_db_tests: move does_mcp_server_exist outside
`if MCP_AVAILABLE:` so it's importable on Python < 3.10
4. build_and_test: fix datetime.fromisoformat('...Z') on Python 3.9
(Z suffix support was added in 3.11)
5. proxy_logging_guardrails: fix container name typo my-app-2 -> my-app-3
6. upload-coverage: use `uv tool run` instead of `uv run --with` to avoid
resolving the full workspace (which fails for Python 3.14)
This commit is contained in:
parent
93d340c1ad
commit
491aa7ea51
@ -420,6 +420,9 @@ jobs:
|
|||||||
chmod +x docker/entrypoint.sh
|
chmod +x docker/entrypoint.sh
|
||||||
./docker/entrypoint.sh
|
./docker/entrypoint.sh
|
||||||
set -e
|
set -e
|
||||||
|
- run:
|
||||||
|
name: Generate Prisma Client
|
||||||
|
command: uv run --no-sync python -m prisma generate
|
||||||
# Run pytest and generate JUnit XML report
|
# Run pytest and generate JUnit XML report
|
||||||
- run:
|
- run:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
@ -2161,7 +2164,7 @@ jobs:
|
|||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Start outputting logs for second container
|
name: Start outputting logs for second container
|
||||||
command: docker logs -f my-app-2
|
command: docker logs -f my-app-3
|
||||||
background: true
|
background: true
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
@ -2962,8 +2965,8 @@ jobs:
|
|||||||
rm -f /tmp/uv-install.sh
|
rm -f /tmp/uv-install.sh
|
||||||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
|
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
uv run --with 'coverage[toml]==7.10.6' coverage combine realtime_translation_coverage ocr_coverage search_coverage mcp_coverage litellm_mcps_tests_coverage logging_coverage audio_coverage local_testing_part1_coverage local_testing_part2_coverage pass_through_unit_tests_coverage batches_coverage guardrails_coverage redis_caching_coverage
|
uv tool run --from 'coverage[toml]==7.10.6' coverage combine realtime_translation_coverage ocr_coverage search_coverage mcp_coverage litellm_mcps_tests_coverage logging_coverage audio_coverage local_testing_part1_coverage local_testing_part2_coverage pass_through_unit_tests_coverage batches_coverage guardrails_coverage redis_caching_coverage
|
||||||
uv run --with 'coverage[toml]==7.10.6' coverage xml
|
uv tool run --from 'coverage[toml]==7.10.6' coverage xml
|
||||||
- codecov/upload:
|
- codecov/upload:
|
||||||
file: ./coverage.xml
|
file: ./coverage.xml
|
||||||
|
|
||||||
|
|||||||
@ -58,6 +58,21 @@ router = APIRouter(prefix="/v1/mcp", tags=["mcp"])
|
|||||||
MCP_AVAILABLE: bool = True
|
MCP_AVAILABLE: bool = True
|
||||||
|
|
||||||
TEMPORARY_MCP_SERVER_TTL_SECONDS = 300
|
TEMPORARY_MCP_SERVER_TTL_SECONDS = 300
|
||||||
|
|
||||||
|
|
||||||
|
def does_mcp_server_exist(
|
||||||
|
mcp_server_records: Iterable[Any], mcp_server_id: str
|
||||||
|
) -> bool:
|
||||||
|
"""
|
||||||
|
Check if the mcp server with the given id exists in the iterable of mcp servers.
|
||||||
|
|
||||||
|
Defined at module level (outside ``if MCP_AVAILABLE``) so it can be imported
|
||||||
|
on Python < 3.10 where the ``mcp`` package is unavailable.
|
||||||
|
"""
|
||||||
|
for mcp_server_record in mcp_server_records:
|
||||||
|
if mcp_server_record.server_id == mcp_server_id:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
DEFAULT_MCP_REGISTRY_VERSION = "1.0.0"
|
DEFAULT_MCP_REGISTRY_VERSION = "1.0.0"
|
||||||
LITELLM_MCP_SERVER_NAME = "litellm-mcp-server"
|
LITELLM_MCP_SERVER_NAME = "litellm-mcp-server"
|
||||||
LITELLM_MCP_SERVER_DESCRIPTION = "MCP Server for LiteLLM"
|
LITELLM_MCP_SERVER_DESCRIPTION = "MCP Server for LiteLLM"
|
||||||
@ -503,17 +518,6 @@ if MCP_AVAILABLE:
|
|||||||
)
|
)
|
||||||
return prisma_client
|
return prisma_client
|
||||||
|
|
||||||
def does_mcp_server_exist(
|
|
||||||
mcp_server_records: Iterable[LiteLLM_MCPServerTable], mcp_server_id: str
|
|
||||||
) -> bool:
|
|
||||||
"""
|
|
||||||
Check if the mcp server with the given id exists in the iterable of mcp servers
|
|
||||||
"""
|
|
||||||
for mcp_server_record in mcp_server_records:
|
|
||||||
if mcp_server_record.server_id == mcp_server_id:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Router to fetch all MCP tools available for the current key
|
# Router to fetch all MCP tools available for the current key
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
|
|||||||
@ -18,3 +18,4 @@ exclude = ["litellm/types/*", "litellm/__init__.py", "litellm/proxy/example_conf
|
|||||||
"litellm/proxy/guardrails/guardrail_hooks/guardrail_benchmarks/test_eval.py" = ["PLR0915"]
|
"litellm/proxy/guardrails/guardrail_hooks/guardrail_benchmarks/test_eval.py" = ["PLR0915"]
|
||||||
"litellm/responses/streaming_iterator.py" = ["PLR0915"]
|
"litellm/responses/streaming_iterator.py" = ["PLR0915"]
|
||||||
"litellm/files/main.py" = ["PLR0915"]
|
"litellm/files/main.py" = ["PLR0915"]
|
||||||
|
"litellm/llms/litellm_proxy/skills/sandbox_executor.py" = ["PLR0915"]
|
||||||
|
|||||||
@ -73,13 +73,15 @@ async def test_create_budget_with_duration(budget_setup):
|
|||||||
), "The budget_reset_at field should not be None"
|
), "The budget_reset_at field should not be None"
|
||||||
|
|
||||||
# Calculate the expected reset time: created_at + 1 day.
|
# Calculate the expected reset time: created_at + 1 day.
|
||||||
expected_reset_at_date = datetime.fromisoformat(
|
# Replace trailing 'Z' with '+00:00' for Python 3.9 compat (fromisoformat
|
||||||
budget_setup["created_at"]
|
# only learned to accept 'Z' in Python 3.11).
|
||||||
) + timedelta(days=1)
|
created_at_str = budget_setup["created_at"].replace("Z", "+00:00")
|
||||||
|
expected_reset_at_date = datetime.fromisoformat(created_at_str) + timedelta(days=1)
|
||||||
|
|
||||||
# Allow for a small tolerance in seconds for the timestamp calculation.
|
# Allow for a small tolerance in seconds for the timestamp calculation.
|
||||||
tolerance_seconds = 3
|
tolerance_seconds = 3
|
||||||
actual_reset_at_date = datetime.fromisoformat(budget_setup["budget_reset_at"])
|
reset_at_str = budget_setup["budget_reset_at"].replace("Z", "+00:00")
|
||||||
|
actual_reset_at_date = datetime.fromisoformat(reset_at_str)
|
||||||
time_difference = abs(
|
time_difference = abs(
|
||||||
(actual_reset_at_date - expected_reset_at_date).total_seconds()
|
(actual_reset_at_date - expected_reset_at_date).total_seconds()
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user