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.
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
15 # TODO(fungi) Switch this to "error" once the following are solved
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 # py310... importlib._bootstrap raises ImportWarning
21 # "_SixMetaPathImporter.find_spec() not found; falling back to find_module()"
22 # but this can't be matched by message for unknown reasons
23 # py310... pip._vendor.urllib3.connection and pip._vendor.urllib3.util.ssl_
24 # both raise DeprecationWarning "ssl module: PROTOCOL_TLS is deprecated" but
25 # this can't be matched by message because it contains a colon
26 # multiple callers raise DeprecationWarning "The distutils package is
27 # deprecated and slated for removal in Python 3.12. Use setuptools or check
28 # PEP 632 for potential alternatives"
29 # multiple callers raise DeprecationWarning "Creating a LegacyVersion has been
30 # deprecated and will be removed in the next major release"
32 PYTHONWARNINGS = error, ignore::DeprecationWarning:distutils.command.install, ignore::ImportWarning:importlib._bootstrap, ignore::DeprecationWarning:pip._vendor.urllib3.connection, ignore::DeprecationWarning:pip._vendor.urllib3.util.ssl_, 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
33 VIRTUALENV_CREATOR = venv
34 commands = mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
37 description = check for potential security risks in source code
39 commands = bandit -r mudpy -x mudpy/tests {posargs}
43 description = find common spelling mistakes in code and documentation
45 commands = codespell {posargs}
49 description = start an interactive demo with the sample config
50 commands = mudpy {posargs}
53 description = build release artifacts and check for conformance
54 allowlist_externals = rm
59 rm -fr {toxinidir}/dist
61 twine check --strict {toxinidir}/dist/*
65 # Build an sdist into a temporary location so we'll have AUTHORS and ChangeLog
66 # files to include. Keep usedevelop on so that the project dependencies will be
67 # installed in the venv.
68 description = generate hypertext documentation
69 allowlist_externals = rm
74 rm -fr {toxinidir}/doc/build
75 python -m build --outdir={toxinidir}/doc/build/dist --sdist
76 sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
79 description = style checks and static analysis of source code
83 commands = flake8 {posargs}
86 [testenv:selftest_config]
87 description = run the selftest with the included sample config
88 commands = mudpy_selftest etc/mudpy.yaml
91 # Run the selftest before checking YAML files so we'll be sure to also catch at
92 # least some which are generated by the application, making sure it creates
93 # them with the same style we enforce for those carried in the repository.
94 description = test data files for correct syntax and formatting
97 mudpy_selftest mudpy/tests/fixtures/test_daemon.yaml
98 yamllint --strict {posargs} .
102 exclude = .git, .tox, *lib/python*, *egg, build