diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2022-08-08 16:29:21 +0100 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2022-09-14 09:29:18 +0000 |
commit | 61684f9a4691449dc8aa129976789e3feab2b713 (patch) | |
tree | cab7a21789ce08f18fd7ec1bd323da78262031eb /tox.ini | |
parent | f5b293d0927506c2a979a091bf0d07ecc78fa181 (diff) | |
download | mlia-61684f9a4691449dc8aa129976789e3feab2b713.tar.gz |
MLIA-571 Use tox to run additional project tasks
- Remove coverage from the pre-commit hooks as it takes too long and is
not really suited to be a pre-commit hook
- Added tox environments:
- 'coverage': Run the code coverage.
The code coverage was moved from the pre-commit hooks to tox.
- 'lint': Run the pre-commit hooks
- 'build': Build a distribution of MLIA
- 'docs': Create documentation from the source code.
Directory docs/ was added and copyright and license information
add to files.
Change-Id: Ife92b68043295ce41a0f2352ee2b2878329f4953
Diffstat (limited to 'tox.ini')
-rw-r--r-- | tox.ini | 40 |
1 files changed, 39 insertions, 1 deletions
@@ -5,6 +5,44 @@ envlist = test [testenv:test] description = Run the unit tests. -deps = pytest +deps = + pytest==7.1.1 commands = pytest {posargs:tests/} + +[testenv:coverage] +description = Run the code coverage of the unit tests. +deps = + {[testenv:test]deps} + pytest-cov==3.0.0 + +commands = + pytest --cov=mlia --cov-report term-missing --cov-fail-under=95 tests/ + +[testenv:lint] +description = Run the pre-commit hooks. +usedevelop = True +extras = + dev +# Workaround to resolve an issue with markdownlint in a docker environment +passenv = HOME +commands = + pre-commit run --all-files --hook-stage=push {posargs} + +[testenv:build] +description = Build a wheel file (platform name as optional argument [manylinux2014_aarch64, manylinux2014_x86_64]). +deps = + build +commands = + python -m build --wheel --config-setting=--global-option=--plat-name={posargs:manylinux2014_x86_64} + +[testenv:docs] +description = Create the documentation. +allowlist_externals = make +usedevelop = True +deps = + Sphinx==4.5.0 + sphinx-rtd-theme==1.0.0 +commands = + sphinx-apidoc -f -o docs/source src/mlia + make --directory docs html |