okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 1 | [tox] |
ricolin | aca56c7 | 2024-11-13 14:36:13 +0800 | [diff] [blame^] | 2 | envlist = py3,linters |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 3 | skipsdist = True |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 4 | sitepackages = False |
| 5 | skip_missing_interpreters = True |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 6 | |
| 7 | [testenv] |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 8 | setenv = |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 9 | VIRTUAL_ENV={envdir} |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 10 | PYTHONWARNINGS=default::DeprecationWarning |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 11 | PYTHONHASHSEED=0 |
| 12 | TERM=linux |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 13 | |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 14 | deps = |
| 15 | flake8 |
| 16 | -r{toxinidir}/test-requirements.txt |
| 17 | -r{toxinidir}/requirements.txt |
| 18 | -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} |
| 19 | |
| 20 | install_commands = |
| 21 | pip install {opts} {packages} |
| 22 | |
| 23 | |
ricolin | aca56c7 | 2024-11-13 14:36:13 +0800 | [diff] [blame^] | 24 | [testenv:{py3,py38,py39,py310}] |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 25 | basepython = python3 |
| 26 | deps = -r{toxinidir}/test-requirements.txt |
| 27 | commands = stestr run --slowest {posargs} |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 28 | |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 29 | [testenv:cover] |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 30 | basepython = python3 |
| 31 | deps = -r{toxinidir}/requirements.txt |
| 32 | -r{toxinidir}/test-requirements.txt |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 33 | setenv = |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 34 | {[testenv]setenv} |
| 35 | PYTHON=coverage run |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 36 | commands = |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 37 | coverage erase |
| 38 | stestr run --slowest {posargs} |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 39 | coverage combine |
| 40 | coverage html -d cover |
| 41 | coverage xml -o cover/coverage.xml |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 42 | coverage report |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 43 | |
ricolin | aca56c7 | 2024-11-13 14:36:13 +0800 | [diff] [blame^] | 44 | [testenv:linters] |
| 45 | skipsdist = True |
| 46 | deps = |
| 47 | pre-commit |
| 48 | commands = |
| 49 | pre-commit run --all-files --show-diff-on-failure |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 50 | |
Susanta Gautam | 7bfec4f | 2021-04-16 16:22:14 +0545 | [diff] [blame] | 51 | [testenv:venv] |
| 52 | commands = {posargs} |
okozachenko | 093ce9e | 2021-04-01 22:47:39 +0300 | [diff] [blame] | 53 | |
| 54 | [flake8] |
| 55 | # E123, E125 skipped as they are invalid PEP-8. |
| 56 | |
| 57 | show-source = True |
| 58 | ignore = E123,E125 |
| 59 | builtins = _ |
| 60 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |