| 1 |
[tox] |
| 2 |
isolated_build = True |
| 3 |
minversion = 3.20.0 |
| 4 |
distshare = {homedir}/.tox/distshare |
| 5 |
envlist = |
| 6 |
linting |
| 7 |
py38 |
| 8 |
py39 |
| 9 |
py310 |
| 10 |
py311 |
| 11 |
py312 |
| 12 |
py313 |
| 13 |
pypy3 |
| 14 |
py38-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} |
| 15 |
doctesting |
| 16 |
doctesting-coverage |
| 17 |
plugins |
| 18 |
py38-freeze |
| 19 |
docs |
| 20 |
docs-checklinks |
| 21 |
|
| 22 |
# checks that 3.11 native ExceptionGroup works with exceptiongroup |
| 23 |
# not included in CI. |
| 24 |
py311-exceptiongroup |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
[testenv] |
| 29 |
commands = |
| 30 |
{env:_PYTEST_TOX_COVERAGE_RUN:} pytest {posargs:{env:_PYTEST_TOX_DEFAULT_POSARGS:}} |
| 31 |
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest |
| 32 |
coverage: coverage combine |
| 33 |
coverage: coverage report -m |
| 34 |
passenv = |
| 35 |
COVERAGE_* |
| 36 |
PYTEST_ADDOPTS |
| 37 |
TERM |
| 38 |
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST |
| 39 |
setenv = |
| 40 |
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} |
| 41 |
|
| 42 |
# See https://docs.python.org/3/library/io.html#io-encoding-warning |
| 43 |
# If we don't enable this, neither can any of our downstream users! |
| 44 |
PYTHONWARNDEFAULTENCODING=1 |
| 45 |
|
| 46 |
# Configuration to run with coverage similar to CI, e.g. |
| 47 |
# "tox -e py38-coverage". |
| 48 |
coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m |
| 49 |
coverage: _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess |
| 50 |
coverage: COVERAGE_FILE={toxinidir}/.coverage |
| 51 |
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc |
| 52 |
|
| 53 |
doctesting: _PYTEST_TOX_POSARGS_DOCTESTING=doc/en |
| 54 |
|
| 55 |
nobyte: PYTHONDONTWRITEBYTECODE=1 |
| 56 |
|
| 57 |
lsof: _PYTEST_TOX_POSARGS_LSOF=--lsof |
| 58 |
|
| 59 |
xdist: _PYTEST_TOX_POSARGS_XDIST=-n auto |
| 60 |
extras = dev |
| 61 |
deps = |
| 62 |
doctesting: PyYAML |
| 63 |
exceptiongroup: exceptiongroup>=1.0.0rc8 |
| 64 |
numpy: numpy>=1.19.4 |
| 65 |
pexpect: pexpect>=4.8.0 |
| 66 |
pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git |
| 67 |
pylib: py>=1.8.2 |
| 68 |
unittestextras: twisted |
| 69 |
unittestextras: asynctest |
| 70 |
xdist: pytest-xdist>=2.1.0 |
| 71 |
xdist: -e . |
| 72 |
{env:_PYTEST_TOX_EXTRA_DEP:} |
| 73 |
|
| 74 |
[testenv:linting] |
| 75 |
skip_install = True |
| 76 |
basepython = python3 |
| 77 |
deps = pre-commit>=2.9.3 |
| 78 |
commands = pre-commit run --all-files --show-diff-on-failure {posargs:} |
| 79 |
setenv = |
| 80 |
# pre-commit and tools it launches are not clean of this warning. |
| 81 |
PYTHONWARNDEFAULTENCODING= |
| 82 |
|
| 83 |
[testenv:docs] |
| 84 |
basepython = python3 |
| 85 |
usedevelop = True |
| 86 |
deps = |
| 87 |
-r{toxinidir}/doc/en/requirements.txt |
| 88 |
# https://github.com/twisted/towncrier/issues/340 |
| 89 |
towncrier<21.3.0 |
| 90 |
commands = |
| 91 |
python scripts/towncrier-draft-to-file.py |
| 92 |
# the '-t changelog_towncrier_draft' tags makes sphinx include the draft |
| 93 |
# changelog in the docs; this does not happen on ReadTheDocs because it uses |
| 94 |
# the standard sphinx command so the 'changelog_towncrier_draft' is never set there |
| 95 |
sphinx-build -W --keep-going -b html doc/en doc/en/_build/html -t changelog_towncrier_draft {posargs:} |
| 96 |
setenv = |
| 97 |
# Sphinx is not clean of this warning. |
| 98 |
PYTHONWARNDEFAULTENCODING= |
| 99 |
|
| 100 |
[testenv:docs-checklinks] |
| 101 |
basepython = python3 |
| 102 |
usedevelop = True |
| 103 |
changedir = doc/en |
| 104 |
deps = -r{toxinidir}/doc/en/requirements.txt |
| 105 |
commands = |
| 106 |
sphinx-build -W -q --keep-going -b linkcheck . _build |
| 107 |
setenv = |
| 108 |
# Sphinx is not clean of this warning. |
| 109 |
PYTHONWARNDEFAULTENCODING= |
| 110 |
|
| 111 |
[testenv:regen] |
| 112 |
changedir = doc/en |
| 113 |
basepython = python3 |
| 114 |
passenv = |
| 115 |
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST |
| 116 |
deps = |
| 117 |
PyYAML |
| 118 |
regendoc>=0.8.1 |
| 119 |
sphinx |
| 120 |
allowlist_externals = |
| 121 |
make |
| 122 |
commands = |
| 123 |
make regen |
| 124 |
setenv = |
| 125 |
# We don't want this warning to reach regen output. |
| 126 |
PYTHONWARNDEFAULTENCODING= |
| 127 |
|
| 128 |
[testenv:plugins] |
| 129 |
# use latest versions of all plugins, including pre-releases |
| 130 |
pip_pre=true |
| 131 |
# use latest pip to get new dependency resolver (#7783) |
| 132 |
download=true |
| 133 |
install_command=python -m pip install {opts} {packages} |
| 134 |
changedir = testing/plugins_integration |
| 135 |
deps = -rtesting/plugins_integration/requirements.txt |
| 136 |
setenv = |
| 137 |
PYTHONPATH=. |
| 138 |
# Command temporarily removed until pytest-bdd is fixed: |
| 139 |
# https://github.com/pytest-dev/pytest/pull/11785 |
| 140 |
# pytest bdd_wallet.py |
| 141 |
commands = |
| 142 |
pip check |
| 143 |
pytest --cov=. simple_integration.py |
| 144 |
pytest --ds=django_settings simple_integration.py |
| 145 |
pytest --html=simple.html simple_integration.py |
| 146 |
pytest --reruns 5 simple_integration.py |
| 147 |
pytest pytest_anyio_integration.py |
| 148 |
pytest pytest_asyncio_integration.py |
| 149 |
pytest pytest_mock_integration.py |
| 150 |
pytest pytest_trio_integration.py |
| 151 |
pytest pytest_twisted_integration.py |
| 152 |
pytest simple_integration.py --force-sugar --flakes |
| 153 |
|
| 154 |
[testenv:py38-freeze] |
| 155 |
changedir = testing/freeze |
| 156 |
deps = |
| 157 |
pyinstaller |
| 158 |
commands = |
| 159 |
{envpython} create_executable.py |
| 160 |
{envpython} tox_run.py |
| 161 |
|
| 162 |
[testenv:release] |
| 163 |
description = do a release, required posarg of the version number |
| 164 |
basepython = python3 |
| 165 |
usedevelop = True |
| 166 |
passenv = * |
| 167 |
deps = |
| 168 |
colorama |
| 169 |
github3.py |
| 170 |
pre-commit>=2.9.3 |
| 171 |
wheel |
| 172 |
# https://github.com/twisted/towncrier/issues/340 |
| 173 |
towncrier<21.3.0 |
| 174 |
commands = python scripts/release.py {posargs} |
| 175 |
|
| 176 |
[testenv:prepare-release-pr] |
| 177 |
description = prepare a release PR from a manual trigger in GitHub actions |
| 178 |
usedevelop = {[testenv:release]usedevelop} |
| 179 |
passenv = {[testenv:release]passenv} |
| 180 |
deps = {[testenv:release]deps} |
| 181 |
commands = python scripts/prepare-release-pr.py {posargs} |
| 182 |
|
| 183 |
[testenv:generate-gh-release-notes] |
| 184 |
description = generate release notes that can be published as GitHub Release |
| 185 |
basepython = python3 |
| 186 |
usedevelop = True |
| 187 |
deps = |
| 188 |
pypandoc |
| 189 |
commands = python scripts/generate-gh-release-notes.py {posargs} |