Client for the cloudstorage microservice, based off the SFDS Microservice platform
- falcon: bare-metal Python web API framework
- gunicorn: Python WSGI HTTP Server for UNIX
- pytest: Python testing tool
- pylint: code analysis for Python
- sentry: error tracking tool
- jsend: a specification for a simple, no-frills, JSON based format for application-level communication
- Python3 (Mac OS X / Windows)
- Pipenv & Virtual Environments (virtualenv / virtualenvwrapper)
Install Pipenv (if needed)
$ pip install --user pipenv
Install included packages
$ pipenv install
Set ACCESS_KEY environment var and start WSGI Server
$ pipenv run gunicorn 'service.microservice:start_service()'
Run Pytest
$ pipenv run python -m pytest
Get code coverage report
$ pipenv run python -m pytest --cov=service tests/ --cov-fail-under=100
Open with cURL or web browser
$ curl --header "ACCESS_KEY: 123456" http://127.0.0.1:8000/welcome
Auto-reload on code changes
$ pipenv run gunicorn --reload 'service.microservice:start_service()'
Code coverage command with missing statement line numbers
$ pipenv run python -m pytest --cov=service tests/ --cov-report term-missing
Set up git hook scripts with pre-commit
$ pipenv run pre-commit install
- CircleCI builds fail when trying to run coveralls.
- Log into coveralls.io to obtain the coverall token for your repo.
- Create an environment variable in CircleCI with the name COVERALLS_REPO_TOKEN and the coverall token value.