Closed jamesbraza closed 6 days ago
@jamesbraza what needs to be changed here?
cd litellm/tests
pytest . -x -vv
works
cd litellm/litellm/tests
pytest . -x -vv
works
So check this:
git clone git@github.com:BerriAI/litellm.git
cd litellm
python -m venv venv && source venv/bin/activate
pip install poetry
poetry install --with dev
pytest tests # Fails with ImportError: cannot import name 'Router' from 'litellm' (unknown location)
cd tests
pytest # Fails with ModuleNotFoundError: No module named 'openai.types.beta.threads.message_content'
cd ../litellm/tests
pytest # Fails with ModuleNotFoundError: No module named 'openai.types.beta.threads.message_content'
pytest . # Fails with ModuleNotFoundError: No module named 'fastapi', 'opentelemetry', 'backoff'
I am more just sharing that LiteLLM is somewhat sensitive to starting directory because pytest
only works when run from specific directories with specific parameterizations (e.g. specifying a file_or_dir
of .
).
If one sets things up nicely (e.g. specifying testpaths
in a config), one should just be able to invoke pytest
from the repo root and have everything work.
One other issue is that poetry install --with dev
doesn't seem to install everything necessary to run tests. Maybe there should be more Poetry groups made, or the dev
group should be expanded
Also, feel free to close this out. I am more just pointing out the "getting started" developing has opportunities for improvement
What happened?
This should work:
Second to last line, I get the below error:
Last line, I get the below error:
Can we fix the Poetry -->
pytest
workflowRelevant log output
No response
Twitter / LinkedIn details
No response