1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
[tox]
skip_missing_interpreters = True
skipsdist=True
minversion = 4.0.12
envlist =
# Python environments with specific backend
py{py3,310,311,312,313}-{x11,wayland}
docs,
packaging-{x11,wayland},
# For running pytest locally
test-{x11,wayland,both}
# Set up some variables that can be used multiple times
[base]
deps =
setuptools >= 40.5.0
dbus-fast
wheel
cffi
xcffib >= 1.4.0
cairocffi >= 1.7.0
# We use "!x11" here so pywayland is installed both in CI wayland environment
# But also when users run locally (as both backends are run in that scenario)
!x11: pywayland==0.4.17
!x11: xkbcommon >= 0.3
testdeps =
pytest >= 6.2.1
{wayland,x11}: coverage
libcst >= 1.0.0
PyGObject
isort
mypy
commands =
# pywayland has to be installed before pywlroots
!x11: pip install pywlroots==0.17.0
pip install --break-system-packages .
!x11: {toxinidir}/scripts/ffibuild
# These are the environments that should be triggered by Github Actions
[testenv:py{py3,310,311,312,313}-{wayland,x11}]
# This is required in order to get UTF-8 output inside of the subprocesses
# that our tests use.
setenv = LC_CTYPE = en_US.UTF-8
# Pass Display down to have it for the tests available
passenv = DISPLAY,WAYLAND_DISPLAY,LDFLAGS,CFLAGS
allowlist_externals =
*/ffibuild
convert
deps =
{[base]deps}
{[base]testdeps}
commands =
{[base]commands}
# pypy3 is very slow when running coverage reports so we skip it
pypy3-x11: python3 -m pytest --backend=x11 {posargs}
pypy3-wayland: python3 -m pytest --backend=wayland {posargs}
py3{10,11,12,13}-x11: coverage run -m pytest --backend=x11 {posargs}
py3{10,11,12,13}-wayland: coverage run -m pytest --backend=wayland {posargs}
# Coverage is only run via GithubActions
# Coverage runs tests in parallel so we need to combine results into a single file
!pypy3-{wayland,x11}: coverage combine -q
# Include a text summary in the build log
!pypy3-{wayland,x11}: coverage report -m
# Create an xml summary to be submitted to coveralls.io
!pypy3-{wayland,x11}: coverage xml
# Basic environment for local testing
[testenv:test]
# This is required in order to get UTF-8 output inside of the subprocesses
# that our tests use.
setenv = LC_CTYPE = en_US.UTF-8
# Pass Display down to have it for the tests available
passenv = DISPLAY,WAYLAND_DISPLAY,LDFLAGS,CFLAGS
allowlist_externals =
*/ffibuild
convert
deps =
{[base]deps}
{[base]testdeps}
commands =
{[base]commands}
python -m pytest {posargs}
# Additional local environments with specified backends
[testenv:test-{x11,wayland,both}]
# This is required in order to get UTF-8 output inside of the subprocesses
# that our tests use.
setenv = LC_CTYPE = en_US.UTF-8
# Pass Display down to have it for the tests available
passenv = DISPLAY,WAYLAND_DISPLAY,LDFLAGS,CFLAGS
allowlist_externals =
*/ffibuild
convert
deps =
{[base]deps}
{[base]testdeps}
commands =
{[base]commands}
x11: python -m pytest --backend=x11 {posargs}
wayland: python -m pytest --backend=wayland {posargs}
both: python -m pytest --backend=wayland --backend=x11 {posargs}
[testenv:packaging-{x11,wayland}]
deps =
check-manifest
twine
build
commands =
check-manifest
python3 -m build --sdist .
twine check dist/*
[testenv:docs]
deps = -r{toxinidir}/docs/requirements.txt
commands =
pip install -r{toxinidir}/requirements.txt
python3 setup.py build_sphinx -W
[gh-actions]
python =
pypy-3.10: pypy3
3.10: py310
3.11: py311
3.12: py312
3.13: py313, packaging
[gh-actions:env]
BACKEND =
x11: x11
wayland: wayland
|