838e4916557df3156f6c611622123dae2c4747fe
[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 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://github.com/pypa/setuptools/issues/2086 is fixed in a new release of
17 # Setuptools and the vendored copy in Python 3.8 and later updated with it;
18 # also that won't work for Python 3.6 due to the older Setuptools there still
19 # calling imp instead of importlib so probably not while we still support 3.6
20 setenv =
21     PYTHONWARNINGS=default::DeprecationWarning
22     VIRTUALENV_CREATOR=venv
23 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
24
25 [testenv:bandit]
26 setenv =
27     PYTHONWARNINGS=error
28 deps = bandit
29 commands = bandit -r mudpy -x mudpy/tests {posargs}
30 usedevelop = False
31
32 [testenv:codespell]
33 setenv =
34     PYTHONWARNINGS=error
35 deps = codespell
36 commands = codespell {posargs}
37 usedevelop = False
38
39 [testenv:demo]
40 commands = mudpy {posargs}
41
42 [testenv:dist]
43 allowlist_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 allowlist_externals = rm
56 deps =
57     -r{toxinidir}/requirements.txt
58     -r{toxinidir}/doc/requirements.txt
59 commands =
60     rm -fr doc/build
61     python setup.py sdist
62     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
63 usedevelop = False
64
65 [testenv:flake8]
66 setenv =
67     PYTHONWARNINGS=error
68 deps =
69     flake8
70     flake8-bugbear
71 commands = flake8 {posargs}
72 usedevelop = False
73
74 [testenv:selftest_config]
75 commands = mudpy_selftest etc/mudpy.yaml
76
77 [testenv:yamllint]
78 setenv =
79     PYTHONWARNINGS=error
80 deps = yamllint
81 commands = yamllint --strict {posargs} .
82 usedevelop = False
83
84 [flake8]
85 show-source = True
86 exclude=.git,.tox,*lib/python*,*egg,build