diff --git a/README.md b/README.md index dd9b6c66..a89baa86 100644 --- a/README.md +++ b/README.md @@ -115,16 +115,19 @@ Please see the documentation of the `QuantToQCDQ` transformation to learn more a ## Development -Install in editable mode in a venv: +Install in editable mode in a Python virtual environment: ``` git clone https://github.com/fastmachinelearning/qonnx cd qonnx virtualenv -p python3.8 venv source venv/bin/activate +pip install --upgrade pip pip install -e .[qkeras,testing] ``` +### Running tests + Run entire test suite, parallelized across CPU cores: ``` pytest -n auto --verbose @@ -135,6 +138,22 @@ Run a particular test and fall into pdb if it fails: pytest --pdb -k "test_extend_partition.py::test_extend_partition[extend_id1-2]" ``` +### Linting + +If you plan to make pull requests to the qonnx repo, linting will be required. +We use a pre-commit hook to auto-format Python code and check for issues. See https://pre-commit.com/ for installation. Once you have `pre-commit`, +you can install the hooks into your local clone of the qonnx repo: + +``` +cd qonnx +source venv/bin/activate +pip install pre-commit +pre-commit install +``` + +Every time you commit some code, the pre-commit hooks will first run, performing various checks and fixes. In some cases pre-commit won’t be able to +fix the issues and you may have to fix it manually, then run git commit once again. The checks are configured in .pre-commit-config.yaml under the repo root. + ## Why QONNX? The QONNX representation has several advantages compared to other alternatives, as summarized in the table below.