aboutsummaryrefslogtreecommitdiff
path: root/tox.ini
blob: e398fa46e424a7480e9c0045057497c02100f590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
[tox]
envlist = test
isolated_build = true

[testenv:test]
description = Run the unit tests.
deps =
    pytest==7.4.0
commands =
    pytest --no-success-flaky-report {posargs:tests/}

[testenv:{e2e,e2e_setup}]
description = Run the end-to-end tests.
# Re-use the same env for both e2e and e2e_setup
envdir={toxworkdir}/e2e
deps =
    {[testenv:test]deps}
    rst2pdf
setenv =
    PYTHONUNBUFFERED=1
    COLUMNS=120
    MLIA_E2E_CONFIG_FILE={posargs:e2e_config/e2e_tests_config.json}
    LD_LIBRARY_PATH=:/opt/VHT
passenv =
    ARMLMD_LICENSE_FILE
commands =
    e2e_setup: {posargs}
    e2e: pytest --collect-only -m "e2e" "tests_e2e"
    e2e: pytest -s -v --capture=tee-sys --durations=0 --durations-min=5 --tb=long --junit-xml=report/report.xml -m "e2e" "tests_e2e"


[testenv:coverage]
description = Run the code coverage of the unit tests.
deps =
    {[testenv:test]deps}
    pytest-cov==4.1.0
commands =
    pytest --cov=mlia --cov-report term-missing --cov-fail-under=95 --no-success-flaky-report tests/

[testenv:{lint,lint_setup}]
description = Run and setup the pre-commit hooks.
# Re-use the same env for both lint and lint_setup
envdir={toxworkdir}/lint
deps =
    {[testenv:test]deps}
    mypy==1.5.1
    pylint==2.17.5
    pre-commit
# Pass the following environment variables:
# - HOME: Workaround for an issue with markdownlint in a docker environment
# - SKIP: Allows skipping of pre-commit hooks, e.g. "SKIP=reuse tox -e lint"
passenv =
    HOME
    SKIP
commands =
    lint_setup: pre-commit install-hooks
    lint: 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~=0.10.0
commands =
    python -m build --wheel --config-setting=--build-option=--plat-name={posargs:manylinux2014_x86_64}

[testenv:docs]
description = Create the documentation.
allowlist_externals = make
deps =
    Sphinx==5.0.0
    sphinx-rtd-theme==1.0.0
commands =
    sphinx-apidoc -f -o docs/source src/mlia
    make --directory docs html

[testenv:changelog]
description = Generate changelog using Commitizen.
deps =
    commitizen==3.13.0
commands =
    cz changelog --file-name RELEASES.md --incremental