forked from phoenix/litellm-mirror
(test) installing litellm
This commit is contained in:
parent
bd340562b8
commit
abe0ec601c
2 changed files with 22 additions and 67 deletions
|
@ -1,6 +1,7 @@
|
||||||
version: 2.1
|
version: 2.1
|
||||||
jobs:
|
jobs:
|
||||||
local_testing:
|
installing_litellm_on_python:
|
||||||
|
local_testing:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python:3.8
|
- image: circleci/python:3.8
|
||||||
working_directory: ~/project
|
working_directory: ~/project
|
||||||
|
@ -8,87 +9,25 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Check if litellm dir was updated or if pyproject.toml was modified
|
|
||||||
command: |
|
|
||||||
if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep -E 'pyproject\.toml|litellm/')" ]; then
|
|
||||||
echo "litellm updated"
|
|
||||||
else
|
|
||||||
echo "No changes to litellm or pyproject.toml. Skipping tests."
|
|
||||||
circleci step halt
|
|
||||||
fi
|
|
||||||
- restore_cache:
|
|
||||||
keys:
|
|
||||||
- v1-dependencies-{{ checksum ".circleci/requirements.txt" }}
|
|
||||||
- run:
|
|
||||||
name: Install Dependencies
|
name: Install Dependencies
|
||||||
command: |
|
command: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install -r .circleci/requirements.txt
|
python -m pip install -r .circleci/requirements.txt
|
||||||
pip install "pytest==7.3.1"
|
|
||||||
pip install "pytest-asyncio==0.21.1"
|
|
||||||
pip install mypy
|
|
||||||
pip install "google-generativeai>=0.3.2"
|
|
||||||
pip install "google-cloud-aiplatform>=1.38.0"
|
|
||||||
pip install "boto3>=1.28.57"
|
|
||||||
pip install "aioboto3>=12.3.0"
|
|
||||||
pip install langchain
|
|
||||||
pip install "langfuse>=2.0.0"
|
|
||||||
pip install numpydoc
|
|
||||||
pip install traceloop-sdk==0.0.69
|
|
||||||
pip install openai
|
pip install openai
|
||||||
pip install prisma
|
pip install prisma
|
||||||
pip install "httpx==0.24.1"
|
pip install "httpx==0.24.1"
|
||||||
pip install "gunicorn==21.2.0"
|
|
||||||
pip install "anyio==3.7.1"
|
|
||||||
pip install "aiodynamo==23.10.1"
|
|
||||||
pip install "asyncio==3.4.3"
|
|
||||||
pip install "apscheduler==3.10.4"
|
|
||||||
pip install "PyGithub==1.59.1"
|
|
||||||
pip install python-multipart
|
|
||||||
- save_cache:
|
|
||||||
paths:
|
|
||||||
- ./venv
|
|
||||||
key: v1-dependencies-{{ checksum ".circleci/requirements.txt" }}
|
|
||||||
- run:
|
|
||||||
name: Run prisma ./entrypoint.sh
|
|
||||||
command: |
|
|
||||||
set +e
|
|
||||||
chmod +x entrypoint.sh
|
|
||||||
./entrypoint.sh
|
|
||||||
set -e
|
|
||||||
- run:
|
|
||||||
name: Black Formatting
|
|
||||||
command: |
|
|
||||||
cd litellm
|
|
||||||
python -m pip install black
|
|
||||||
python -m black .
|
|
||||||
cd ..
|
|
||||||
- run:
|
|
||||||
name: Linting Testing
|
|
||||||
command: |
|
|
||||||
cd litellm
|
|
||||||
python -m pip install types-requests types-setuptools types-redis
|
|
||||||
if ! python -m mypy . --ignore-missing-imports; then
|
|
||||||
echo "mypy detected errors"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
|
|
||||||
# Run pytest and generate JUnit XML report
|
- run:
|
||||||
|
name: Check if litellm dir was updated or if pyproject.toml was modified
|
||||||
- run:
|
- run:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
command: |
|
command: |
|
||||||
pwd
|
pwd
|
||||||
ls
|
ls
|
||||||
python -m pytest -vv litellm/tests/ -x --junitxml=test-results/junit.xml --durations=5
|
python -m pytest -vv litellm/tests/test_python_38.py
|
||||||
no_output_timeout: 120m
|
no_output_timeout: 120m
|
||||||
|
|
||||||
# Store test results
|
|
||||||
- store_test_results:
|
|
||||||
path: test-results
|
|
||||||
|
|
||||||
build_and_test:
|
build_and_test:
|
||||||
machine:
|
machine:
|
||||||
image: ubuntu-2204:2023.10.1
|
image: ubuntu-2204:2023.10.1
|
||||||
|
|
16
litellm/tests/test_python_38.py
Normal file
16
litellm/tests/test_python_38.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import sys, os, time
|
||||||
|
import traceback, asyncio
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
sys.path.insert(
|
||||||
|
0, os.path.abspath("../..")
|
||||||
|
) # Adds the parent directory to the system path
|
||||||
|
|
||||||
|
|
||||||
|
def test_using_litellm():
|
||||||
|
try:
|
||||||
|
import litellm
|
||||||
|
except Exception as e:
|
||||||
|
pytest.fail(
|
||||||
|
f"Error occurred: {e}. Installing litellm on python3.8 failed please retry"
|
||||||
|
)
|
Loading…
Add table
Add a link
Reference in a new issue