Contributing#
We adhere to PEP 8 style guidelines and use the following formatting tools:
and we use pytest for running unit tests.
To install these tools use
pip install flake8 black isort pytest
or (from inside the directory where the pyproject.toml is located)
pip install ".[dev]"
To run black on all python files within a directory, use
black .
Similarly to run isort on all python files within a directory, use
isort .
One can run black or isort on a single file by changing . to <file_name>.
All tests should be in the tests directory.
To run pytest use
pytest
this will search recursively for any files of the form test_*.py or _test.py (for information on how pytest searches for tests see here).
To run pytest on a single file use
pytest <filename>
Note
For developing, if one clones the git repo, one should run ./setup.sh script to setup the necessary git-hooks in the repo after cloning it.