Start checking codebase with the codespell tool
[mudpy.git] / tox.ini
1 # Copyright (c) 2016-2020 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.1
7 envlist = bandit, codespell, dist, docs, flake8, yamllint, selftest_config, py3
8 skipsdist = True
9 ignore_basepython_conflict = True
10
11 [testenv]
12 basepython = python3
13 usedevelop = True
14 install_command = pip install {opts} {packages}
15 # TODO(fungi) Switch this to "error" and remove env-specific copies once
16 # https://review.opendev.org/735433 and https://review.opendev.org/735443
17 # merge and appear in a new PBR release
18 setenv =
19     PYTHONWARNINGS=default::DeprecationWarning
20 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
21
22 [testenv:bandit]
23 setenv =
24     PYTHONWARNINGS=error
25 deps = bandit
26 commands = bandit -r mudpy -x mudpy/tests {posargs}
27 usedevelop = False
28
29 [testenv:codespell]
30 # TODO(fungi) switch to a proper PyPI dep once .codespellrc is supported in a
31 # release version, and ratchet down deprecation warnings for it at that point
32 #setenv =
33 #    PYTHONWARNINGS=error
34 #deps = codespell
35 deps = git+https://github.com/codespell-project/codespell
36 commands = codespell {posargs}
37 usedevelop = False
38
39 [testenv:demo]
40 commands = mudpy {posargs}
41
42 [testenv:dist]
43 whitelist_externals = rm
44 deps =
45     pbr
46     twine
47     wheel
48 commands =
49     rm -fr dist
50     python setup.py bdist_wheel sdist
51     twine check dist/*
52 usedevelop = False
53
54 [testenv:docs]
55 setenv =
56     PYTHONWARNINGS=error
57 whitelist_externals = rm
58 deps =
59     -r{toxinidir}/requirements.txt
60     -r{toxinidir}/doc/requirements.txt
61 commands =
62     rm -fr doc/build
63     python setup.py sdist
64     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
65 usedevelop = False
66
67 [testenv:flake8]
68 setenv =
69     PYTHONWARNINGS=error
70 deps =
71     flake8
72     flake8-bugbear
73 commands = flake8 {posargs}
74 usedevelop = False
75
76 [testenv:selftest_config]
77 commands = mudpy_selftest etc/mudpy.yaml
78
79 [testenv:yamllint]
80 setenv =
81     PYTHONWARNINGS=error
82 deps = yamllint
83 commands = yamllint --strict {posargs} .
84 usedevelop = False
85
86 [flake8]
87 show-source = True
88 exclude=.git,.tox,*lib/python*,*egg,build