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