Launch a postgres docker container and create a test db
# Bash
docker run -d --name climb_db \
-e POSTGRES_PASSWORD="greentea" \
-e POSTGRES_USER="maccha" \
-e POSTGRES_DB="climbdb" \
-p 5432:5432 postgres
# Windows
docker run -d --name climb_db ^
-e POSTGRES_PASSWORD="greentea" ^
-e POSTGRES_USER="maccha" ^
-e POSTGRES_DB="climbdb" ^
-p 5432:5432 postgres
docker exec -it climb_db bash
psql -h localhost -U maccha climbdb
climbdb=# create database climbdb_test;Create virtualenv
virtualenv venv --python=python3.8
# For MacOS and Linux
source update_environment.sh
pip install -r requirements.txt
# For Windows
chmod +x update_environment.sh
source update_environment.sh
pip install -r requirements.txtRun everytime you start a new terminal on this project
# from project root
source update_environment.shdocker build -t myimage .
docker run -d --name mycontainer -p 80:80 myimage
# from root directory
uvicorn src.main:app --reloadOnly run the following once you have climbdb running
# to create a new migration
alembic revision --autogenerate -m <commit message>
# to update to head
alembic upgrade headpytest -vv <your_test_file>
# Run all tests (recommended)
pytest -vv