Skip to content

Commit

Permalink
[Bug Fix]: ImportError: cannot import name 'T' from 're' (#7314)
Browse files Browse the repository at this point in the history
* fix unused imports

* add test for python 3.12

* re introduce error - as a test

* update config for ci/cd

* fix python 13 install

* bump pyyaml

* bump numpy

* fix embedding requests

* bump pillow dep

* bump version

* bump pydantic

* bump tiktoken

* fix import

* fix python 3.13 import

* fix unused imports in tests/*
  • Loading branch information
ishaan-jaff authored Dec 19, 2024
1 parent c7f14e9 commit a790d43
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
35 changes: 34 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,33 @@ jobs:
command: |
pwd
ls
python -m pytest -vv tests/local_testing/test_python_38.py
python -m pytest -vv tests/local_testing/test_basic_python_version.py
installing_litellm_on_python_3_13:
docker:
- image: cimg/python:3.13.1
auth:
username: ${DOCKERHUB_USERNAME}
password: ${DOCKERHUB_PASSWORD}
working_directory: ~/project

steps:
- checkout
- run:
name: Install Dependencies
command: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
pip install "pytest==7.3.1"
pip install "pytest-retry==1.6.3"
pip install "pytest-asyncio==0.21.1"
pip install "pytest-cov==5.0.0"
- run:
name: Run tests
command: |
pwd
ls
python -m pytest -vv tests/local_testing/test_basic_python_version.py
check_code_and_doc_quality:
docker:
Expand Down Expand Up @@ -1607,6 +1633,12 @@ workflows:
only:
- main
- /litellm_.*/
- installing_litellm_on_python_3_13:
filters:
branches:
only:
- main
- /litellm_.*/
- load_testing:
filters:
branches:
Expand Down Expand Up @@ -1638,6 +1670,7 @@ workflows:
- e2e_ui_testing
- litellm_proxy_unit_testing
- installing_litellm_on_python
- installing_litellm_on_python_3_13
- proxy_logging_guardrails_model_info_tests
- proxy_pass_through_endpoint_tests
- check_code_and_doc_quality
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ httpx==0.27.0 # Pin Httpx dependency
openai==1.55.3 # openai req.
fastapi==0.111.0 # server dep
backoff==2.2.1 # server dep
pyyaml==6.0.0 # server dep
pyyaml==6.0.2 # server dep
uvicorn==0.29.0 # server dep
gunicorn==22.0.0 # server dep
boto3==1.34.34 # aws bedrock/sagemaker calls
redis==5.0.0 # caching
numpy==1.24.3 # semantic caching
numpy==2.1.1 # semantic caching
prisma==0.11.0 # for db
mangum==0.17.0 # for aws lambda functions
pynacl==1.5.0 # for encrypting keys
Expand All @@ -19,12 +19,12 @@ google-generativeai==0.5.0 # for vertex ai calls
async_generator==1.10.0 # for async ollama calls
langfuse==2.45.0 # for langfuse self-hosted logging
prometheus_client==0.20.0 # for /metrics endpoint on proxy
orjson==3.9.15 # fast /embedding responses
orjson==3.10.12 # fast /embedding responses
apscheduler==3.10.4 # for resetting budget in background
fastapi-sso==0.10.0 # admin UI, SSO
pyjwt[crypto]==2.9.0
python-multipart==0.0.9 # admin UI
Pillow==10.3.0
Pillow==11.0.0
azure-ai-contentsafety==1.0.0 # for azure content safety
azure-identity==1.16.1 # for azure content safety
azure-storage-file-datalake==12.15.0 # for azure buck storage logging
Expand All @@ -37,16 +37,16 @@ cryptography==42.0.7

### LITELLM PACKAGE DEPENDENCIES
python-dotenv==1.0.0 # for env
tiktoken==0.7.0 # for calculating usage
tiktoken==0.8.0 # for calculating usage
importlib-metadata==6.8.0 # for random utils
tokenizers==0.14.0 # for calculating usage
tokenizers==0.20.2 # for calculating usage
click==8.1.7 # for proxy cli
jinja2==3.1.4 # for prompt templates
certifi==2024.7.4 # [TODO] clean up
aiohttp==3.10.2 # for network calls
aioboto3==12.3.0 # for async sagemaker calls
tenacity==8.2.3 # for retrying requests, when litellm.num_retries set
pydantic==2.7.1 # proxy + openai req.
pydantic==2.10.0 # proxy + openai req.
jsonschema==4.22.0 # validating json schema
websockets==10.4 # for realtime API
####
1 change: 0 additions & 1 deletion tests/llm_translation/test_anthropic_text_completion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import os
from re import T
import sys
import traceback

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from datetime import datetime
from unittest.mock import AsyncMock

from pydantic.main import Model

sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system path
Expand Down
2 changes: 0 additions & 2 deletions tests/logging_callback_tests/test_otel_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from datetime import datetime
from unittest.mock import AsyncMock

from pydantic.main import Model

sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system-path
Expand Down
2 changes: 0 additions & 2 deletions tests/logging_callback_tests/test_standard_logging_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from datetime import datetime
from unittest.mock import AsyncMock

from pydantic.main import Model

sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from datetime import datetime
from unittest.mock import AsyncMock

from pydantic.main import Model

sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from datetime import datetime
from unittest.mock import AsyncMock

from pydantic.main import Model

sys.path.insert(
0, os.path.abspath("../..")
) # Adds the parent directory to the system-path
Expand Down

0 comments on commit a790d43

Please sign in to comment.