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 - fix mypy linting on ci/cd (#14981)

Ishaan Jaff3e793d71222c
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 41c3ba1133f..14e59a63e1a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -51,6 +51,33 @@ jobs:
command: |
python -m pytest tests/windows_tests/test_litellm_on_windows.py -v
+ mypy_linting:
+ docker:
+ - image: cimg/python:3.12
+ auth:
+ username: ${DOCKERHUB_USERNAME}
+ password: ${DOCKERHUB_PASSWORD}
+ working_directory: ~/project
+ resource_class: medium
+
+ steps:
+ - checkout
+ - setup_google_dns
+ - run:
+ name: Install Dependencies
+ command: |
+ python -m pip install --upgrade pip
+ python -m pip install -r requirements.txt
+ pip uninstall fastuuid -y
+ pip install "mypy==1.18.2"
+ - run:
+ name: MyPy Type Checking
+ command: |
+ cd litellm
+ # Use the same approach as GitHub Actions, explicitly exclude fastuuid to avoid segfaults
+ python -m mypy . --ignore-missing-imports
+ cd ..
+ no_output_timeout: 10m
local_testing:
docker:
- image: cimg/python:3.12
@@ -140,13 +167,6 @@ jobs:
python -m pip install black
python -m black .
cd ..
- - run:
- name: Linting Testing
- command: |
- cd litellm
- # Use the same simple approach that works in GitHub Actions
- python -m mypy . --ignore-missing-imports --show-traceback
- cd ..
# Run pytest and generate JUnit XML report
- run:
@@ -3071,6 +3091,12 @@ workflows:
only:
- main
- /litellm_.*/
+ - mypy_linting:
+ filters:
+ branches:
+ only:
+ - main
+ - /litellm_.*/
- local_testing:
filters:
branches:
@@ -3317,6 +3343,7 @@ workflows:
- main
- publish_to_pypi:
requires:
+ - mypy_linting
- local_testing
- build_and_test
- e2e_openai_endpoints