Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

CovidZero/hummingbird-v2

Repository files navigation

Hummingbird V2

Python Tests Python Code Style Enforcement Auto Assign

Project Resources


  • Language: Python 3.7
  • Package manager: pip
  • Main dependencies: Flask 1.1.1, Flask-RESTPus
  • Tests: unittests

Running out of docker container

- Setup dependencies


cd hummingbird-v2
virtualenv venv
source venv/bin/activate
pip install -r src/requirements.txt
pip install -r requirements_local.txt

- Setup database - using SQLite


export PYTHONPATH=$PYTHONPATH:$(pwd)/src
export FLASK_APP=src/main.py
export FLASK_ENV=local
flask db init --directory=local_migrations
flask db migrate --directory=local_migrations
flask db upgrade --directory=local_migrations   

- Running the application


export PYTHONPATH=$PYTHONPATH:$(pwd)/src
export FLASK_ENV=local
python src/main.py 

- Tests


export PYTHONPATH=$PYTHONPATH:$(pwd)/src
export FLASK_ENV=testing
python tests/runner.py

- Flake 8 For Style Guide Enforcement


flake8 src

- Database Seed


cd hummingbird-v2
export PYTHONPATH=$PYTHONPATH:$(pwd)/src
export FLASK_ENV=local
python src/main.py 
flask seed run

Running with docker container

- Setup your environment using docker


docker-compose build

- Start your environment using docker


docker-compose up

- Setup database for development


$ docker exec -it api /bin/bash

export PYTHONPATH=$PYTHONPATH:$(pwd)/src
export FLASK_APP=src/main.py
export FLASK_ENV=development
flask db init --directory=local_migrations
flask db migrate --directory=../local_migrations
flask db upgrade --directory=local_migrations  

Swagger API Doc

Contribution Guide