Add descriptions to tox testenvs
[mudpy.git] / tox.ini
1 # Copyright (c) 2016-2021 mudpy authors. Permission to use, copy,
2 # modify, and distribute this software is granted under terms
3 # provided in the LICENSE file distributed with this software.
4
5 [tox]
6 minversion = 3.18
7 envlist = bandit, codespell, dist, docs, flake8, yamllint, selftest_config, py3
8 skipsdist = True
9 ignore_basepython_conflict = True
10
11 [testenv]
12 description = run the functional selftest with optimized configuration
13 basepython = python3
14 usedevelop = True
15 install_command = pip install {opts} {packages}
16 # TODO(fungi) Switch this to "error" and remove env-specific copies once
17 # https://github.com/pypa/setuptools/issues/2086 is fixed in a new release of
18 # Setuptools and the vendored copy in Python 3.8 and later updated with it;
19 # also that won't work for Python 3.6 due to the older Setuptools there still
20 # calling imp instead of importlib so probably not while we still support 3.6
21 setenv =
22     PYTHONWARNINGS=default::DeprecationWarning
23     VIRTUALENV_CREATOR=venv
24 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
25
26 [testenv:bandit]
27 setenv =
28     PYTHONWARNINGS=error
29 description = check for potential security risks in source code
30 deps = bandit
31 commands = bandit -r mudpy -x mudpy/tests {posargs}
32 usedevelop = False
33
34 [testenv:codespell]
35 setenv =
36     PYTHONWARNINGS=error
37 description = find common spelling mistakes in code and documentation
38 deps = codespell
39 commands = codespell {posargs}
40 usedevelop = False
41
42 [testenv:demo]
43 description = start an interactive demo with the sample config
44 commands = mudpy {posargs}
45
46 [testenv:dist]
47 description = build release artifacts and check for conformance
48 allowlist_externals = rm
49 deps =
50     pbr
51     twine
52     wheel
53 commands =
54     rm -fr dist
55     python setup.py bdist_wheel sdist
56     twine check dist/*
57 usedevelop = False
58
59 [testenv:docs]
60 description = generate hypertext documentation
61 allowlist_externals = rm
62 deps =
63     -r{toxinidir}/requirements.txt
64     -r{toxinidir}/doc/requirements.txt
65 commands =
66     rm -fr doc/build
67     python setup.py sdist
68     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
69 usedevelop = False
70
71 [testenv:flake8]
72 setenv =
73     PYTHONWARNINGS=error
74 description = style checks and static analysis of source code
75 deps =
76     flake8
77     flake8-bugbear
78 commands = flake8 {posargs}
79 usedevelop = False
80
81 [testenv:selftest_config]
82 description = run the selftest with the included sample config
83 commands = mudpy_selftest etc/mudpy.yaml
84
85 [testenv:yamllint]
86 setenv =
87     PYTHONWARNINGS=error
88 description = test data files for correct syntax and formatting
89 deps = yamllint
90 commands = yamllint --strict {posargs} .
91 usedevelop = False
92
93 [flake8]
94 show-source = True
95 exclude=.git,.tox,*lib/python*,*egg,build