- Create
.envfile under project root withOPENAI_API_KEY=<YOUR_OPENAI_API_KEY>TRUCKQUOTE_API_KEY=<YOUR_TRUCKQUOTE_AIP_KEY>
- Install Dependencies
pip install -r requirements.txtdotenv run uvicorn src.api.main:app --port 8000Remarks:
- prefix
dotenv runwill set environment values defined inside.envto the following command. - --autoreload is not recommended, I met multiple bugs.
There are two folders under tests:
unit_testsfor unit testscomponent_testsfor component tests (with openai call)
just run with PYTHONPATH=$PYTHONPATH:. pytest tests/unit_tests/
or PYTHONPATH=$PYTHONPATH:. pytest tests/component_tests/
You need to first start the app to run integration tests.
Then run PYTHONPATH=$PYTHONPATH:. pytest tests/functional_tests/
local development db (sqlite) is located at data/dev.db