Skip to content

Commit 326a525

Browse files
authored
Merge pull request #130 from fastmachinelearning/feature/readme_dev_updates
Updates to dev docs: pip upgrade, linting
2 parents db969e6 + b0a6088 commit 326a525

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,19 @@ Please see the documentation of the `QuantToQCDQ` transformation to learn more a
115115

116116
## Development
117117

118-
Install in editable mode in a venv:
118+
Install in editable mode in a Python virtual environment:
119119

120120
```
121121
git clone https://github.com/fastmachinelearning/qonnx
122122
cd qonnx
123123
virtualenv -p python3.8 venv
124124
source venv/bin/activate
125+
pip install --upgrade pip
125126
pip install -e .[qkeras,testing]
126127
```
127128

129+
### Running tests
130+
128131
Run entire test suite, parallelized across CPU cores:
129132
```
130133
pytest -n auto --verbose
@@ -135,6 +138,22 @@ Run a particular test and fall into pdb if it fails:
135138
pytest --pdb -k "test_extend_partition.py::test_extend_partition[extend_id1-2]"
136139
```
137140

141+
### Linting
142+
143+
If you plan to make pull requests to the qonnx repo, linting will be required.
144+
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`,
145+
you can install the hooks into your local clone of the qonnx repo:
146+
147+
```
148+
cd qonnx
149+
source venv/bin/activate
150+
pip install pre-commit
151+
pre-commit install
152+
```
153+
154+
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
155+
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.
156+
138157
## Why QONNX?
139158

140159
The QONNX representation has several advantages compared to other alternatives, as summarized in the table below.

0 commit comments

Comments
 (0)