dspy
dspy copied to clipboard
Bug: Unable to run tests locally
Bug: Getting Unable to import dspy when trying to run the new tests
Steps to reproduce:
- Clone main branch
- python -m venv .env
- source .env/bin/activate
- pip install -r requirements.txt
- pytest tests/predict/test_predict.py
Alternate steps to reproduce:
- Clone main branch
- poetry install
- poetry shell
- pytest tests/predict/test_predict.py
This throws a ModuleNotFoundError: No module named 'dspy'
Why does this matter? 2 Reasons:
- I was going to help Cyrus with part of the backend refactor, but can't test my code locally
- We can't integrate the tests into CI
Full trace:
==================================================================================== test session starts ====================================================================================
platform darwin -- Python 3.11.4, pytest-7.4.0, pluggy-1.0.0
rootdir: /Users/isaac/Projects/dspy
plugins: anyio-3.5.0
collected 0 items / 1 error
========================================================================================== ERRORS ===========================================================================================
______________________________________________________________________ ERROR collecting tests/predict/test_predict.py _______________________________________________________________________
ImportError while importing test module '/Users/isaac/Projects/dspy/tests/predict/test_predict.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../anaconda3/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/predict/test_predict.py:1: in <module>
import dspy
E ModuleNotFoundError: No module named 'dspy'
This could totally be wrong with how I understand local python builds or some other mistake. Regardless, there should be a little section in the readme about how to run the tests, and get the env setup locally for development
I think it is because we need to add pytest as a dev dependency for poetry
Ahh great catch. Happy to merge any fixes