First off, thanks for considering to contribute to this project!
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
We use git hooks through pre-commit to enforce and automatically check some "rules". Please install them (pre-commit install
) before to push any commit.
See the relevant configuration file: .pre-commit-config.yaml
.
Make sure your code roughly follows PEP-8 and keeps things consistent with the rest of the code:
- sorted imports: isort is used to sort imports
- static analysis: flake8 is used to catch some dizziness and keep the source code healthy.
- static typing: mypy is used to have static type checks.
We use the linter commitizen with the Conventional Commits configuration (the default one).
The commit message writing process can be guided by using cz commit
instead of git commit
.
In order to run unit tests, please consider installing the dependencies that are referenced in the requirement folder:
pip install -r requirements/unit_tests.txt
In particular, we use icontract
in this context (this dependency is set as an extra dependency, as it might be unpackaged on some environments). The unit tests are run through pytest
. This testing mode is actually used in the CI.