Skip to content

Latest commit

 

History

History
91 lines (60 loc) · 1.89 KB

CONTRIBUTING.md

File metadata and controls

91 lines (60 loc) · 1.89 KB

Deep Thought Contributing Guide

Documentation for contributing to Deep Thought.

Install Poetry

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

Update dependencies

poetry update # update dependencies

Add a new dependency

poetry add <package-name> # add a new dependency

Remove a dependency

poetry remove <package-name> # remove a dependency

Common Developer Tasks

Most of these tasks are automated in the Makefile that lives in the root of the project.

Run the code

make run # which runs: uvicorn src.app:app --reload

Lint the code

make lint # which runs: pylint src

Run the unit tests

make test # which runs: python -m unittest discover

Run the API spec validation tests

make test-api # which runs a custom script that validates the API spec for all available versions

Run the API spec validation tests for a specific version

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

Run ALL available tests

make test-all # which runs: make lint, make test, and make test-api

Update all dependencies

make update # which runs a script that updates all dependencies

To see the dependencies that need to be updated

pip list --outdated

API Details

Information about the API can be found in the API documentation.