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 # TODO(fungi) Switch this to "error" once the following are solved
15 #
16 # py311... Cython.Compiler.Main raises FutureWarning "Cython directive
17 #   'language_level' not set, using 2 for now (Py2). This will change in a
18 #   later release!" but this can't be matched by message because it has a comma
19 # py310... distutils.command.install raises DeprecationWarning "The
20 #   distutils.sysconfig module is deprecated, use sysconfig instead" but this
21 #   can't be matched by message because it contains a comma
22 # flake8... flake8.plugins.manager raises DeprecationWarning "SelectableGroups
23 #   dict interface is deprecated. Use select."
24 # multiple callers raise DeprecationWarning "The distutils package is
25 #   deprecated and slated for removal in Python 3.12. Use setuptools or check
26 #   PEP 632 for potential alternatives"
27 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
28 #   deprecated and will be removed in the next major release"
29 # SetupTools raises
30 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning "setup.py
31 #   install is deprecated. Use build and pip and other standards-based tools."
32 #   but only the message can be matched because the exception is private
33 # SetupTools raises
34 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning
35 #   "setup_requires is deprecated. Supply build dependencies using PEP 517
36 #   pyproject.toml build-requires." but only the message can be matched because
37 #   the exception is private
38 # SetupTools raises
39 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning "easy_install
40 #   command is deprecated. Use build and pip and other standards-based tools."
41 #   but only the message can be matched because the exception is private
42 # filelock raises DeprecationWarning "use poll_interval instead of
43 #   poll_intervall"
44 # pip._vendor.certifi.core and pip._vendor.pep517.in_process raise
45 #   DeprecationWarning "path is deprecated. Use files() instead. Refer to
46 #   https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy
47 #   for migration advice." but this can't be matched by message because it
48 #   contains a colon
49 setenv =
50     PYTHONWARNINGS = error, ignore::FutureWarning:Cython.Compiler.Main, 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, ignore:setup.py install is deprecated. Use build and pip and other standards-based tools., ignore:easy_install command is deprecated. Use build and pip and other standards-based tools., ignore:use poll_interval instead of poll_intervall:DeprecationWarning, ignore::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process
51     VIRTUALENV_CREATOR = venv
52 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
53 deps = {toxinidir}
54
55 [testenv:bandit]
56 description = check for potential security risks in source code
57 deps = bandit
58 commands = bandit -r mudpy -x mudpy/tests {posargs}
59
60 [testenv:codespell]
61 description = find common spelling mistakes in code and documentation
62 deps = codespell
63 commands = codespell {posargs}
64
65 [testenv:demo]
66 description = start an interactive demo with the sample config
67 commands = mudpy {posargs}
68
69 [testenv:dist]
70 description = build release artifacts and check for conformance
71 allowlist_externals = rm
72 deps =
73     build
74     twine
75 commands =
76     rm -fr {toxinidir}/dist
77     python -m build
78     twine check --strict {toxinidir}/dist/*
79
80 [testenv:docs]
81 # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog
82 # files to include.
83 description = generate hypertext documentation
84 allowlist_externals = rm
85 deps =
86     {toxinidir}
87     build
88     sphinx
89 commands =
90     rm -fr {toxinidir}/doc/build
91     python -m build --outdir={toxinidir}/doc/build/dist --sdist
92     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
93
94 [testenv:flake8]
95 description = style checks and static analysis of source code
96 deps =
97     flake8
98     flake8-bugbear
99 commands = flake8 {posargs}
100
101 [testenv:selftest_config]
102 description = run the selftest with the included sample config
103 commands = mudpy_selftest etc/mudpy.yaml
104
105 [testenv:yamllint]
106 # Run the selftest before checking YAML files so we'll be sure to also catch at
107 # least some which are generated by the application, making sure it creates
108 # them with the same style we enforce for those carried in the repository.
109 description = test data files for correct syntax and formatting
110 deps =
111     {toxinidir}
112     yamllint
113 commands =
114     mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
115     yamllint --strict {posargs} .
116
117 [flake8]
118 show-source = True
119 exclude = .git, .tox, *lib/python*, *egg, build