A micro service to lookup and parse a CSV file named after a tube rack barcode provided and return the data in the CSV if found.
The routes of the service are:
Endpoint Methods Rule
--------------------------------- ------- ------------------------------
health_check GET /health
racks.get_tubes_from_rack_barcode GET /tube_rack/<tube_rack_barcode>
static GET /static/<path:filename>
- Requirements for Development
- 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
) -
Git hooks are executed using lefthook, install lefthook using homebrew and add the pre-commit and pre-push hooks as follows:
lefthook add pre-commit lefthook add pre-push
-
talisman is used as a credentials checker, to ignore files which it triggers as false positives, follow the instructions in the git commit output by adding the files to be ignore to a
.talismanrc
file and try commit again.
Create a .env
file (or copy the .env.example
file) with the following values:
SETTINGS_PATH=config/development.py
-
Create and enter the virtual environment:
pipenv shell
-
Install the required dependencies:
pipenv install --dev
To run the service:
flask run
To run the test suite:
python -m pytest -vx
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 provided by the mypy library, to run manually:
pipenv run mypy .
This project uses a Docker image as the unit of deployment. The image is created by GitHub actions.
To trigger the creation of a new image, increment the .release-version
version with the
corresponding change according to semver.
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