Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.93 KB

CONTRIBUTING.md

File metadata and controls

51 lines (36 loc) · 1.93 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
  • Google's yapf to make sure the formatting is consistent.
  • pre-commit hook for yapf

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 for yapf, so your code gets auto-formatted 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, best done with docker run --name redis -p 6379:6379 -d redis:6.0, then you can use the project's defaults, i.e. REDIS_URL=redis://localhost:6379/0
  • some fake SMTP service to handle email tests, our recommendations:
    • fake-smtp-server: NodeJS app with a frontend on http://localhost:1080 and SMTP port 1025
    • pure Python one-liner in a separate terminal window: sudo python -m smtpd -n -c DebuggingServer localhost:1025

We use pytest in this project with coverage:

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.