From d8f5866ce214a3fc0490f10389d855c17e1aabde Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Tue, 21 May 2024 10:41:07 +0200 Subject: [PATCH] Docs: Dev instructions in README.md structured Splitted instructions into cloning, pre-commit and running tests. Added instructions how to run tests with tox. --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6289a2a..a688566 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,30 @@ See the [examples](https://github.com/aiidateam/aiida-restapi/tree/master/exampl ```shell git clone https://github.com/aiidateam/aiida-restapi . cd aiida-restapi -pip install -e .[pre-commit,testing] # install extra dependencies +``` + +### Setting up pre-commit + +We use pre-commit to take care for the linting, formatting and type checking. +```shell +pip install -e .[pre-commit] # install extra dependencies pre-commit install # install pre-commit hooks -pytest -v # discover and run all tests +pre-commit run # running pre-commit manually +``` + +### Running tests + +With tox the tests can be run +```shell +pip install tox +tox -e py311 # run all tests for Python 3.11 +tox -av # see all supported environments +``` +tox will creat a custom environment to run the tests in. If you want to run the +tests inside your current environment +```shell +pip install -e .[testing] # install extra dependencies +pytest -v ``` See the [developer guide](http://aiida-restapi.readthedocs.io/en/latest/developer_guide/index.html) for more information.