Documentation for contributing to Deep Thought.
Setup local Python environment for Deep Thought using Poetry for dependency management.
It is assumed that you have already installed Poetry on your local machine. If not, please follow the instructions here.
poetry install # initial installation of dependencies
poetry shell # activate the virtual environment
export PYTHONPATH=$(pwd) # add the current directory to the PYTHONPATH
poetry update # update dependencies
poetry add <package-name> # add a new dependency
poetry remove <package-name> # remove a dependency
Most of these tasks are automated in the Makefile that lives in the root of the project.
make run # which runs: uvicorn src.app:app --reload
make lint # which runs: pylint src
make test # which runs: python -m unittest discover
make test-api # which runs a custom script that validates the API spec for all available versions
make v1 # which runs a custom script that validates the API spec for version 1
# or
make v2 # which runs a custom script that validates the API spec for version 2
make test-all # which runs: make lint, make test, and make test-api
make update # which runs a script that updates all dependencies
pip list --outdated
Information about the API can be found in the API documentation.