Skip to content

Developer's Guide

CI

This project comes with a GitHub Actions pipeline definition.

Develop

First, please install docker on your computer. Docker must be running correctly for these commands to work.

  • If you are using windows, please make sure your editor writes files with the linefeed (\n) line endings.

Next, fork and clone forked repo.

git clone git@your_repo.git
cd extra-model

Then build an image:

docker-compose build

Then run the test suite to see if docker is set up correctly:

docker-compose run test

You are now set to work on your feature.

Testing

You'll be unable to merge code unless the linting and tests pass. You can run these in your container via docker-compose run test.

The tests, linting, and code coverage are run automatically via CI, and you'll see the output on your pull requests.

Generally we should endeavor to write tests for every feature. Every new feature branch should increase the test coverage rather than decreasing it.

We use pytest as our testing framework.

To test/lint your project, you can run docker-compose run test.

Stages

To customize / override a specific testing stage, please read the documentation specific to that tool:

  1. PyTest: https://docs.pytest.org/en/latest/contents.html
  2. Black: https://black.readthedocs.io/en/stable/
  3. Flake8: http://flake8.pycqa.org/en/latest/
  4. Bandit: https://bandit.readthedocs.io/en/latest/
  5. iSort: https://pycqa.github.io/isort/
  6. pydocstyle: http://www.pydocstyle.org/en/stable/