1979c0443cee2c52357880ec32f6e75afb0dab54
[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 # TODO(fungi) Switch this to "error" once the following are solved
16 #
17 # py310... distutils.command.install raises DeprecationWarning "The
18 #   distutils.sysconfig module is deprecated, use sysconfig instead" but this
19 #   can't be matched by message because it contains a comma
20 # py310... importlib._bootstrap raises ImportWarning
21 #   "_SixMetaPathImporter.find_spec() not found; falling back to find_module()"
22 #   but this can't be matched by message for unknown reasons
23 # py310... pip._vendor.urllib3.connection and pip._vendor.urllib3.util.ssl_
24 #   both raise DeprecationWarning "ssl module: PROTOCOL_TLS is deprecated" but
25 #   this can't be matched by message because it contains a colon
26 # multiple callers raise DeprecationWarning "The distutils package is
27 #   deprecated and slated for removal in Python 3.12. Use setuptools or check
28 #   PEP 632 for potential alternatives"
29 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
30 #   deprecated and will be removed in the next major release"
31 setenv =
32     PYTHONWARNINGS = error, ignore::DeprecationWarning:distutils.command.install, ignore::ImportWarning:importlib._bootstrap, ignore::DeprecationWarning:pip._vendor.urllib3.connection, ignore::DeprecationWarning:pip._vendor.urllib3.util.ssl_, ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning
33     VIRTUALENV_CREATOR = venv
34 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
35
36 [testenv:bandit]
37 description = check for potential security risks in source code
38 deps = bandit
39 commands = bandit -r mudpy -x mudpy/tests {posargs}
40 usedevelop = False
41
42 [testenv:codespell]
43 description = find common spelling mistakes in code and documentation
44 deps = codespell
45 commands = codespell {posargs}
46 usedevelop = False
47
48 [testenv:demo]
49 description = start an interactive demo with the sample config
50 commands = mudpy {posargs}
51
52 [testenv:dist]
53 description = build release artifacts and check for conformance
54 allowlist_externals = rm
55 deps =
56     pbr
57     twine
58     wheel
59 commands =
60     rm -fr {toxinidir}/dist
61     python setup.py bdist_wheel sdist
62     twine check --strict {toxinidir}/dist/*
63 usedevelop = False
64
65 [testenv:docs]
66 description = generate hypertext documentation
67 allowlist_externals = rm
68 deps =
69     -r{toxinidir}/requirements.txt
70     -r{toxinidir}/doc/requirements.txt
71 commands =
72     rm -fr doc/build
73     python setup.py sdist
74     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
75 usedevelop = False
76
77 [testenv:flake8]
78 description = style checks and static analysis of source code
79 deps =
80     flake8
81     flake8-bugbear
82 commands = flake8 {posargs}
83 usedevelop = False
84
85 [testenv:selftest_config]
86 description = run the selftest with the included sample config
87 commands = mudpy_selftest etc/mudpy.yaml
88
89 [testenv:yamllint]
90 description = test data files for correct syntax and formatting
91 deps = yamllint
92 commands =
93     mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
94     yamllint --strict {posargs} .
95
96 [flake8]
97 show-source = True
98 exclude = .git, .tox, *lib/python*, *egg, build