forked from beeware/toga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
107 lines (100 loc) · 4.26 KB
/
tox.ini
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
# Flake8 doesn't provide a pyproject configuration, but allows tox.ini
[flake8]
max-line-length = 119
extend-ignore =
# whitespace before :
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
[tox]
# Add Python 3.13 once a wheel for Pillow is available
envlist = py{38,39,310,311,312}-cov,coverage
labels =
test = py-cov,coverage
test38 = py38-cov,coverage38
test39 = py39-cov,coverage39
test310 = py310-cov,coverage310
test311 = py311-cov,coverage311
test312 = py312-cov,coverage312
test313 = py313-cov,coverage313
ci = towncrier-check,docs-lint,pre-commit,py{38,39,310,311,312}-cov,coverage-fail-platform
skip_missing_interpreters = True
[testenv:pre-commit]
skip_install = True
deps =
{tox_root}{/}core[dev]
commands = pre-commit run --all-files --show-diff-on-failure --color=always
# The leading comma generates the "py" environment
[testenv:py{,38,39,310,311,312,313}{,-cov}]
depends = pre-commit
changedir = core
skip_install = True
setenv =
TOGA_BACKEND = toga_dummy
allowlist_externals =
bash
commands =
# TOGA_INSTALL_COMMAND is set to a bash command by the CI workflow
# Install as editable so parallel runs don't clobber the build directory for each other
{env:TOGA_INSTALL_COMMAND:python -m pip install {tox_root}{/}core[dev] {tox_root}{/}dummy}
!cov: python -m pytest {posargs:-vv --color yes}
cov : python -m coverage run -m pytest {posargs:-vv --color yes}
[testenv:coverage{,38,39,310,311,312,313}{,-html}{,-keep}{,-fail}{,-platform}]
depends = pre-commit,py{,38,39,310,311,312,313}{,-cov}
changedir = core
skip_install = True
# by default, coverage should run on oldest supported Python for testing platform coverage.
# however, coverage for a particular Python version should match the version used for pytest.
base_python =
coverage38: py38
coverage39: py39
coverage310: py310
coverage311: py311
coverage312: py312
coverage313: py313
deps =
{tox_root}{/}core[dev]
setenv =
keep: COMBINE_KEEP = --keep
fail: REPORT_FAIL_COND = --fail-under=100
CORE_RCFILE = --rcfile {tox_root}{/}core{/}pyproject.toml
PROJECT_RCFILE = --rcfile {tox_root}{/}pyproject.toml
# disable conditional coverage exclusions for Python version
{platform}: COVERAGE_EXCLUDE_PYTHON_VERSION=disable
commands_pre = python --version
commands =
-python -m coverage combine {env:CORE_RCFILE} {env:COMBINE_KEEP}
html: python -m coverage html {env:PROJECT_RCFILE} --skip-covered --skip-empty
python -m coverage report {env:PROJECT_RCFILE} {env:REPORT_FAIL_COND}
[testenv:towncrier{,-check}]
skip_install = True
deps =
towncrier==24.8.0
{tox_root}{/}core
commands =
check : python -m towncrier.check --compare-with origin/main
!check : python -m towncrier {posargs}
[docs]
docs_dir = {tox_root}{/}docs
build_dir = {[docs]docs_dir}{/}_build
sphinx_args = --show-traceback --fail-on-warning --keep-going --jobs auto
[testenv:docs{,-lint,-all,-live,-live-src}]
# Docs are always built on Python 3.12. See also the RTD config and contribution docs.
base_python = py312
skip_install = True
# give sphinx-autobuild time to shutdown http server
suicide_timeout = 1
deps =
# editable install so docstrings can be updated for 'all' and 'live'
-e {tox_root}{/}core[docs]
passenv =
# On macOS M1, you need to manually set the location of the PyEnchant
# library:
# export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib
PYENCHANT_LIBRARY_PATH
commands =
!lint-!all-!live : python -m sphinx {[docs]sphinx_args} {posargs} --builder html {[docs]docs_dir} {[docs]build_dir}{/}html
lint : python -m sphinx {[docs]sphinx_args} {posargs} --builder spelling {[docs]docs_dir} {[docs]build_dir}{/}spell
lint : python -m sphinx {[docs]sphinx_args} {posargs} --builder linkcheck {[docs]docs_dir} {[docs]build_dir}{/}links
all : python -m sphinx {[docs]sphinx_args} {posargs} --verbose --write-all --fresh-env --builder html {[docs]docs_dir} {[docs]build_dir}{/}html
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} --builder html {[docs]docs_dir} {[docs]build_dir}{/}live
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} --write-all --fresh-env --watch {tox_root}{/}core{/}src{/}toga --builder html {[docs]docs_dir} {[docs]build_dir}{/}live