Merge "CI: Add SonarCloud scan GHA workflow"
[pti/o2.git] / tox.ini
1 # content of: tox.ini , put in same dir as setup.py
2 [tox]
3 envlist=
4     flake8,
5     code,
6     docs,
7     docs-linkcheck,
8
9 minversion = 2.0
10 skipsdist = True
11
12 [testenv]
13 basepython =
14     code: python3
15     flake8: python3
16 setenv =
17         VIRTUAL_ENV={envdir}
18
19 # NOTE: relative paths were used due to '-w' flag for nosetests util
20
21 usedevelop = True
22 install_command = pip install -U {opts} {packages}
23 deps = -r{toxinidir}/requirements.txt
24        -r{toxinidir}/requirements-test.txt
25 whitelist_externals = bash, flake8, pytest
26
27 [testenv:clm]
28 # use pip to report dependencies with versions
29 whitelist_externals = sh
30 commands = sh -c 'pip freeze > requirements.txt'
31
32 [testenv:flake8]
33 commands =
34     flake8 o2ims
35     flake8 o2dms
36     flake8 o2common
37
38 [testenv:code]
39 setenv =
40         O2APP_CONFIG=configs/o2app.conf
41         ALARM_YAML=configs/alarm.yaml
42 commands =
43     pytest tests/unit
44
45 [testenv:nosetests]
46 commands =
47     pytest tests/unit
48
49
50 [testenv:docs]
51 basepython = python3
52 deps = -r{toxinidir}/docs/requirements-docs.txt
53
54 commands =
55     sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
56
57     echo "Generated docs available in {toxinidir}/docs/_build/html"
58
59 allowlist_externals = echo
60
61 [testenv:docs-linkcheck]
62 basepython = python3
63 deps = -r{toxinidir}/docs/requirements-docs.txt
64
65 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
66
67 [flake8]
68 extend-ignore = E231,F401