Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.89 KB

CONTRIBUTING.md

File metadata and controls

62 lines (41 loc) · 1.89 KB

Contribution Guidelines

Submitting PRs

We ❤️ patches, fixes & feature PRs and want to make sure everything goes smoothly for you before and while while submitting a PR.

For development we use:

  • poetry as package manager
  • pytest for testing
  • black to make sure the formatting is consistent.
  • ruff for linting
  • pre-commit hook for formatting and linting

When contributing, ideally you:

  • close an existing issue. If there is none yet for your fix, please create one.
  • write/adapt unit tests
  • use docstrings for public classes/methods & responsible use of comments
  • use meaningful commit messages
  • branch off master and PR against master as well

Setup

  1. Create and activate a new virtual environment

  2. Install development dependencies:

poetry install
  1. Please add a pre-commit hook, so your code gets auto-formatted and linted before committing it:
pre-commit install

Tests

You'll need a few things to run the tests:

  • PostreSQL installation with a DB named gis_test (or define another db name using POSTGRES_DB_TEST) and PostGIS enabled
  • Redis database

Both can be quickly spun up by using the provided docker-compose.test.yml:

docker compose -f docker-compose.test.yml up -d

You'll also need some fake SMTP service to handle email tests, our recommendation: fake-smtp-server, a NodeJS app with a frontend on http://localhost:1080 and SMTP port 1025

We use pytest in this project with coverage:

export API_CONFIG=test
pytest --cov=routing_packager_app

A coverage bot will report the coverage in every PR and we might ask you to increase coverage on new code.