-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
65 lines (56 loc) · 1.67 KB
/
tox.ini
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
[tox]
description = Default tox environments list
envlist =
style,{py38,py39,py310},doc
skip_missing_interpreters = true
isolated_build = true
isolated_build_env = build
[gh-actions]
description = The tox environment to be executed in gh-actions for a given python version
python =
3.8: style,py38-coverage,doc
3.9: style,py39-coverage,doc
3.10: style,py310-coverage,doc
[testenv]
description = Checks for project unit tests
basepython =
py38: python3.8
py39: python3.9
py310: python3.10
{style,reformat,doc,build,notebook,coverage,test}: python3
setenv =
PYTHONUNBUFFERED = yes
install_command =
python -m pip install {opts} {packages}
[testenv:test]
description = Checks for project unit tests
setenv =
PYTEST_EXTRA_ARGS = --junitxml=junit/test-results.xml
commands =
python -m pip install .[tests]
pytest {posargs} {env:PYTEST_EXTRA_ARGS:}
[testenv:coverage]
description = Checks for project unit tests and coverage
setenv =
PYTEST_EXTRA_ARGS = --cov=ansys.edb --cov-report=term --cov-report=xml --cov-report=html
commands =
python -m pip install .[tests]
pytest {posargs} {env:PYTEST_EXTRA_ARGS:}
[testenv:style]
description = Checks project code style
skip_install = true
deps =
pre-commit
commands =
pre-commit install
pre-commit run --all-files --show-diff-on-failure
[testenv:doc]
description = Check if documentation generates properly
commands =
python -m pip install .[doc]
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxworkdir}/doc_out" --color -vW -bhtml
[testenv:notebook]
description = Run Jupyter notebook
commands =
python -m pip install .[notebook]
jupyter notebook notebooks