ungleich_hack_3/CONTRIBUTING.md

56 lines
1.5 KiB
Markdown
Raw Normal View History

2020-05-10 15:14:24 +00:00
## Developer FAQ
### How to maintain the Requirements File (`requirements.txt`)?
The canonical list of installation requirements (including development requirements) is maintained in the [`setup.py`](setup.py) file.
The Requirements File ([`requirements.txt`](requirements.txt)) file must be kept in sync with that list.
To to automatically generate or update `requirements.txt` based on `setup.py`, run [`pip-tools`](https://github.com/jazzband/pip-tools)s `pip-compile`:
```sh
make generate_requirements_file
```
**Warning:** Due to [limitations](https://github.com/jazzband/pip-tools/issues/908) in `pip-tools`, the same workflow can not be used for generating a `dev-requirements.txt` file, and requirements can not be declared in a `setup.cfg` file.
### How to install modules required for development?
```sh
make install_dev
```
2020-05-10 15:14:24 +00:00
### How to run tests?
From the project root directory, execute the following command:
```sh
make test
```
### How to run a code formatter?
2020-05-10 15:14:24 +00:00
This project requires using [Black](https://black.readthedocs.io/) as a code formatter.
From the project root directory, execute the following command to show what must be reformatted:
```sh
make check_code_format
2020-05-10 15:14:24 +00:00
```
Execute the following command to format the code:
2020-05-10 15:14:24 +00:00
```sh
make format_code
```
### How to run a linter?
2020-05-10 15:14:24 +00:00
This project requires using [Flake8](https://flake8.pycqa.org/) as a code linter.
From the project root directory, execute the following command to show what must be corrected:
```sh
make lint
```