Drop deprecation filters for pip and yamllint
[mudpy.git] / tox.ini
1 # Copyright (c) 2016-2022 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... passlib.utils raises DeprecationWarning "'crypt' is deprecated and
17 #   slated for removal in Python 3.13"
18 # py311... mudpy.tests.selftest raises DeprecationWarning "'telnetlib' is
19 #   deprecated and slated for removal in Python 3.13"
20 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
21 #   deprecated and will be removed in the next major release"
22 # SetupTools raises
23 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning "setup.py
24 #   install is deprecated. Use build and pip and other standards-based tools."
25 #   but only the message can be matched because the exception is private
26 # SetupTools raises
27 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning
28 #   "setup_requires is deprecated. Supply build dependencies using PEP 517
29 #   pyproject.toml build-requires." but only the message can be matched because
30 #   the exception is private
31 # SetupTools raises
32 #   setuptools._deprecation_warning.SetuptoolsDeprecationWarning "easy_install
33 #   command is deprecated. Use build and pip and other standards-based tools."
34 #   but only the message can be matched because the exception is private
35 # setuptools.config.pyprojecttoml raises
36 #   setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for
37 #   `[tool.setuptools]` in `pyproject.toml` is still *beta*." but the parent
38 #   Warning class has to be used instead
39 setenv =
40     PYTHONWARNDFAULTENCODING = 1
41     PYTHONWARNINGS = error, ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning, 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:'crypt' is deprecated and slated for removal in Python 3.13:DeprecationWarning:passlib.utils, ignore:'telnetlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:mudpy.tests.selftest, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml
42     PYTHONUTF8 = 1
43     VIRTUALENV_CREATOR = venv
44 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
45 download = true
46 deps = {toxinidir}
47
48 [testenv:bandit]
49 description = check for potential security risks in source code
50 skip_install = True
51 deps = bandit
52 commands = bandit -r mudpy -x mudpy/tests {posargs}
53
54 [testenv:codespell]
55 description = find common spelling mistakes in code and documentation
56 skip_install = True
57 deps = codespell
58 commands = codespell {posargs}
59
60 [testenv:demo]
61 description = start an interactive demo with the sample config
62 commands = mudpy {posargs}
63
64 [testenv:dist]
65 description = build release artifacts and check for conformance
66 skip_install = True
67 deps =
68     build
69     twine
70 commands =
71     {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/dist', ignore_errors=True)"
72     {envpython} -m build
73     twine check --strict {toxinidir}/dist/*
74
75 [testenv:docs]
76 # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog
77 # files to include.
78 description = generate hypertext documentation
79 deps =
80     {[testenv]deps}
81     build
82     sphinx
83 commands =
84     {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/doc/build', ignore_errors=True)"
85     {envpython} -m build --outdir={toxinidir}/doc/build/dist --sdist
86     sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
87
88 [testenv:flake8]
89 description = style checks and static analysis of source code
90 skip_install = True
91 deps = flake8-bugbear
92 commands = flake8 {posargs}
93
94 [testenv:selftest_config]
95 description = run the selftest with the included sample config
96 commands = mudpy_selftest etc/mudpy.yaml
97
98 [testenv:yamllint]
99 # Run the selftest before checking YAML files so we'll be sure to also catch at
100 # least some which are generated by the application, making sure it creates
101 # them with the same style we enforce for those carried in the repository.
102 description = test data files for correct syntax and formatting
103 deps =
104     {[testenv]deps}
105     yamllint
106 commands =
107     mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
108     yamllint --strict {posargs} .
109
110 [flake8]
111 show-source = True
112 exclude = .git, .tox, *lib/python*, *egg, build