diff options
author | erik.andersson@arm.com <erik.andersson@arm.com> | 2022-08-17 15:02:44 +0200 |
---|---|---|
committer | erik.andersson@arm.com <erik.andersson@arm.com> | 2022-08-23 14:58:46 +0200 |
commit | d2969a9a5696fef60415fdb2cf0ebe2864eb73c5 (patch) | |
tree | 0a13a419283e17b9661f5d0bfcc10926f4c8c127 | |
parent | dc7414a00ecf733f0c82c19f848a3f7a2bebab15 (diff) | |
download | ethos-u-vela-d2969a9a5696fef60415fdb2cf0ebe2864eb73c5.tar.gz |
MLBEDSW-6423:Updated documentation to detail new dependencies
Mypy and pylint was previously not included in TESTING.md.
Also, installation of pre-commit, pytest and pytest-cov outside
of a virtual environment was not detailed.
CONTRIBUTIONS.md had an old Python version listed in the conding standard section.
Signed-off-by: erik.andersson@arm.com <erik.andersson@arm.com>
Change-Id: Idff9454083e41d719e6d75e90cb2be2861500eb9
-rw-r--r-- | CONTRIBUTIONS.md | 2 | ||||
-rw-r--r-- | TESTING.md | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 3654f9bc..2f38bd11 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -4,7 +4,7 @@ Contributions to Vela are very much welcomed! ## Coding Standard -Vela is written using Python 3.6 language constructs in order to aid +Vela is written using Python 3.7 language constructs in order to aid compatibility with other tools. All code must also be run through the formatting and linting tools described in [Vela Testing](TESTING.md) @@ -7,9 +7,11 @@ line length. The following code formatting and linting tools are run on all the Python files (excluding the directories `ethosu/vela/tflite/` and `ethosu/vela/ethos_u55_regs` because they contain auto-generated code): +* mypy (code linter) * reorder-python-import (code formatter) * black (code formatter) * flake8 (code linter) +* pylint (code linter) These tools are run using the [pre-commit](https://pre-commit.com/) framework. This is also used to run the following test and coverage tools: @@ -28,6 +30,16 @@ pipenv install -e . --dev The remaining tools will all be installed automatically upon first use. +If a virtual environment is not used, the packages can instead be installed through: + +```bash +pip install pre-commit +... +pip install pytest +... +pip install pytest-cov +``` + ### Add pre-commit hook (Automatically running the tools) To support code development all the above tools can be configured to run @@ -49,12 +61,16 @@ All of the tools can be run individually by invoking them using the following pre-commit framework commands: ```bash +$ pre-commit run mypy --all-files +... $ pre-commit run reorder-python-imports --all-files ... $ pre-commit run black --all-files ... $ pre-commit run flake8 --all-files ... +$ pre-commit run pylint --all-files +... $ pre-commit run pytest ... $ pre-commit run pytest-cov --hook-stage push @@ -65,8 +81,10 @@ Alternatively, all of the commit stage hooks can be run using the command: ```bash $ pre-commit run --all-files +mypy.....................................................................Passed Reorder python imports...................................................Passed black....................................................................Passed flake8...................................................................Passed +pylint...................................................................Passed pytest...................................................................Passed ``` |