A microservice which defines the database used to store automation system run information and exposes endpoints to ease querying.
- Requirements for Development
- Getting Started
- Running
- Testing
- Formatting, Linting and Type Checking
- Deployment
- Miscellaneous
The following tools are required for development:
- python (use
pyenv
or something similar to install the python version specified in thePipfile
) - mySQL 8.0 (a
docker-compose.yml
is included to easily get the database server up and running)
Install the require dependencies:
pipenv install --dev
Create the following database (currently manually):
psd_cherrytrack_dev
To generate dummy data for this project you can use SQL statements from:
- Biosero-SQL.
In particular see biosero-sql/example-queries which can be run manually on
psd_cherrytrack_dev
Flask Migrate is a wrapper around Alembic
To check the current state of the migrations, run:
flask db current
To run the migrations:
flask db upgrade
To run the application:
flask run
Create the following database (currently manually):
psd_cherrytrack_test
Migrate the test database:
SETTINGS_PATH=config/test.py flask db upgrade
To run the test suite:
python -m pytest
This project is formatted using black. To run formatting checks, run:
pipenv run black .
This project is linted using flake8. To lint the code, run:
pipenv run flake8
This project uses static type checking using the mypy library, to run:
pipenv run mypy .
This project uses a Docker image as the unit of deployment. To create a release for deployment, create a release in GitHub and wait for the GitHub action to create the Docker image.
The release version should align with the standards.
To update the table of contents after adding things to this README you can use the markdown-toc node module. To run:
npx markdown-toc -i README.md