@@ -74,8 +74,6 @@ This project follows Google coding conventions, with a few changes that are most
7474configuration files at the top level of the source tree and in ` dev_tools/conf/ ` . The following
7575files configure various tools to the project conventions:
7676
77- * ` dev_tools/conf/.pylintrc ` : Python code
78-
7977* ` .editorconfig ` : basic code editor configuration
8078
8179* ` .hadolint.yaml ` : Dockerfiles
@@ -84,6 +82,10 @@ files configure various tools to the project conventions:
8482
8583* ` .markdownlintrc ` : Markdown files
8684
85+ * ` .pylintrc ` : Python file lint
86+
87+ * ` .pyproject.toml ` : Python tools other than Pylint
88+
8789* ` .yamllint.yaml ` : YAML files
8890
8991#### Code comment conventions
@@ -210,16 +212,6 @@ pre-commit run --all-files
210212
211213After that, the hooks will run automatically when triggered by the corresponding git operations.
212214
213- # ## Type annotation conventions
214-
215- Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). We use
216- [mypy](http://mypy-lang.org/) to check that type annotations are correct, and the following script
217- to run it:
218-
219- ` ` ` shell
220- check/mypy
221- ` ` `
222-
223215# ## Python setup
224216
2252171. Create a Python virtual environment. To use Python' s built-in `venv` package, run:
@@ -239,6 +231,20 @@ check/mypy
239231Please refer to the section _Developer install_ of the [installation instructions](docs/install.md)
240232for information about how to set up a local copy of the software for development.
241233
234+ ### Type annotation conventions
235+
236+ Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). We use
237+ [mypy](http://mypy-lang.org/) to check that type annotations are correct, and the following script
238+ to run it:
239+
240+ ```shell
241+ check/mypy
242+ ```
243+
244+ If your computer has multiple processor cores, you can add the option `-j 0` to the command above to
245+ make Mypy run in parallel for a substantial speed increase.
246+
247+
242248### Linting and formatting
243249
244250Code should meet common style standards for Python and be free of error-prone constructs. We use
@@ -282,7 +288,9 @@ We use [pytest](https://docs.pytest.org) to run our tests and
282288* While developing, periodically check that changes do not break anything. For fast checks, use
283289 `pytest -m "not slow" PATH`, where `PATH` is a directory or pytest file to test.
284290
285- * After finishing a task, run `check/pytest` to test all of the OpenFermion code.
291+ * After finishing a task, run `check/pytest` to test all of the OpenFermion code. If your system
292+ has multiple processor cores, you can add the option `-n auto` to make it run in parallel for a
293+ substantial speed increase. (Beware, though, that this is resource-intensive.)
286294
287295We don' t require 100% coverage, but coverage should be very high, and any uncovered code must be
288296annotated with ` # pragma: no cover` . To ignore coverage of a single line, place ` # pragma: no cover`
@@ -294,9 +302,9 @@ cover` comment on its own line. Note, however, that these annotations should be
294302After a task is finished, run each of the following to make sure everything passes all the tests:
295303
296304* ` check/format-incremental`
297- * ` check/pylint`
305+ * ` check/pylint -j 0 `
298306* ` check/mypy`
299- * ` check/pytest`
307+ * ` check/pytest -n auto `
300308* ` check/pytest-and-incremental-coverage`
301309
302310# ## Pull requests and code reviews
0 commit comments