Drop deprecation filters for pip and yamllint
[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 # flake8... flake8.plugins.manager raises DeprecationWarning "SelectableGroups dict interface is deprecated. Use select."
21 # multiple callers raise DeprecationWarning "The distutils package is
22 #   deprecated and slated for removal in Python 3.12. Use setuptools or check
23 #   PEP 632 for potential alternatives"
24 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
25 #   deprecated and will be removed in the next major release"
26 setenv =
27     PYTHONWARNINGS = error, ignore::DeprecationWarning:distutils.command.install, 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, ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning:flake8.plugins.manager
28     VIRTUALENV_CREATOR = venv
29 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
30
31 [testenv:bandit]
32 description = check for potential security risks in source code
33 deps = bandit
34 commands = bandit -r mudpy -x mudpy/tests {posargs}
35 usedevelop = False
36
37 [testenv:codespell]
38 description = find common spelling mistakes in code and documentation
39 deps = codespell
40 commands = codespell {posargs}
41 usedevelop = False
42
43 [testenv:demo]
44 description = start an interactive demo with the sample config
45 commands = mudpy {posargs}
46
47 [testenv:dist]
48 description = build release artifacts and check for conformance
49 allowlist_externals = rm
50 deps =
51     build
52     twine
53 commands =
54     rm -fr {toxinidir}/dist
55     python -m build
56     twine check --strict {toxinidir}/dist/*
57 usedevelop = False
58
59 [testenv:docs]
60 # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog
61 # files to include. Keep usedevelop on so that the project dependencies will be
62 # installed in the venv.
63 description = generate hypertext documentation
64 allowlist_externals = rm
65 deps =
66     build
67     sphinx
68 commands =
69     rm -fr {toxinidir}/doc/build
70     python -m build --outdir={toxinidir}/doc/build/dist --sdist
71     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
72
73 [testenv:flake8]
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 # Run the selftest before checking YAML files so we'll be sure to also catch at
87 # least some which are generated by the application, making sure it creates
88 # them with the same style we enforce for those carried in the repository.
89 description = test data files for correct syntax and formatting
90 deps = yamllint
91 commands =
92     mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
93     yamllint --strict {posargs} .
94
95 [flake8]
96 show-source = True
97 exclude = .git, .tox, *lib/python*, *egg, build