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.
7 envlist = bandit, codespell, dist, docs, flake8, yamllint, selftest_config, py3
9 ignore_basepython_conflict = True
12 description = run the functional selftest with optimized configuration
14 # TODO(fungi) Switch this to "error" once the following are solved
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 # yamllint... setuptools.command.build_py raises
21 # setuptools._deprecation_warning.SetuptoolsDeprecationWarning "Installing
22 # 'yamllint.conf' as data is deprecated, please list it in `packages`. [...]"
23 # but the message can't be matched because it contains a comma and spans
24 # multiple lines while the custom Warning subclass can't be matched
25 # specifically leading to a blanket ignore for all Warning types in package
27 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
28 # deprecated and will be removed in the next major release"
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
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
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 # setuptools.config.pyprojecttoml raises
43 # setuptools.config.pyprojecttoml._ExperimentalProjectMetadata "Support for
44 # `[tool.setuptools]` in `pyproject.toml` is still *beta*." but the parent
45 # Warning class has to be used instead
46 # pip._vendor.certifi.core and pip._vendor.pep517.in_process raise
47 # DeprecationWarning "path is deprecated. Use files() instead. Refer to
48 # https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy
49 # for migration advice." but this can't be matched by message because it
52 PYTHONWARNDFAULTENCODING = 1
53 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::DeprecationWarning:pip._vendor.certifi.core, ignore::DeprecationWarning:pip._vendor.pep517.in_process, 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::Warning:setuptools.command.build_py, ignore:Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.:Warning:setuptools.config.pyprojecttoml
55 VIRTUALENV_CREATOR = venv
56 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
61 description = check for potential security risks in source code
64 commands = bandit -r mudpy -x mudpy/tests {posargs}
67 description = find common spelling mistakes in code and documentation
70 commands = codespell {posargs}
73 description = start an interactive demo with the sample config
74 commands = mudpy {posargs}
77 description = build release artifacts and check for conformance
83 {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/dist', ignore_errors=True)"
85 twine check --strict {toxinidir}/dist/*
88 # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog
90 description = generate hypertext documentation
96 {envpython} -c "import shutil; shutil.rmtree('{toxinidir}/doc/build', ignore_errors=True)"
97 {envpython} -m build --outdir={toxinidir}/doc/build/dist --sdist
98 sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
101 description = style checks and static analysis of source code
103 deps = flake8-bugbear
104 commands = flake8 {posargs}
106 [testenv:selftest_config]
107 description = run the selftest with the included sample config
108 commands = mudpy_selftest etc/mudpy.yaml
111 # Run the selftest before checking YAML files so we'll be sure to also catch at
112 # least some which are generated by the application, making sure it creates
113 # them with the same style we enforce for those carried in the repository.
114 description = test data files for correct syntax and formatting
119 mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
120 yamllint --strict {posargs} .
124 exclude = .git, .tox, *lib/python*, *egg, build