pferd/DEV.md
Joscha 3efec53f51 Configure code checking and formatting tools
Checking
- mypy
- flake8 (which uses pyflakes and pycodestyle)

Formatting
- autopep8
- isort
2021-05-16 14:31:43 +02:00

2.2 KiB

PFERD Development Guide

PFERD is packaged following the Python Packaging User Guide (in particular this and this guide).

Setting up a dev environment

The use of venv is recommended. To initially set up a development environment, run these commands in the same directory as this file:

$ python -m venv .venv
$ . .venv/bin/activate
$ ./scripts/setup

The setup script installs a few required dependencies and tools. It also installs PFERD via pip install --editable ., which means that you can just run pferd as if it was installed normally. Since PFERD was installed with --editable, there is no need to re-run pip install when the source code is changed.

For more details, see this part of the Python Tutorial and this section on "development mode".

Checking and formatting the code

To run a set of checks against the code, run ./scripts/check in the repo's root directory. This script will run a few tools installed by ./scripts/setup against the entire project.

To format the code, run ./scripts/format in the repo's root directory.

Before committing changes, please make sure the checks return no warnings and the code is formatted.

Contributing

When submitting a PR that adds, changes or modifies a feature, please ensure that the corresponding documentation is updated as well. Also, please ensure that ./scripts/check returns no warnings and the code has been run through ./scripts/format.

In your first PR, please add your name to the LICENSE file.