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 managerpytest
for testingblack
to make sure the formatting is consistent.ruff
for lintingpre-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 againstmaster
as well
-
Create and activate a new virtual environment
-
Install development dependencies:
poetry install
- Please add a pre-commit hook, so your code gets auto-formatted and linted before committing it:
pre-commit install
You'll need a few things to run the tests:
- PostreSQL installation with a DB named
gis_test
(or define another db name usingPOSTGRES_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.