forked from beeware/briefcase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
139 lines (131 loc) · 4.71 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
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
133
134
135
136
137
138
139
# Flake8 doesn't believe in pyproject.toml, so we put the configuration here.
[flake8]
# https://flake8.readthedocs.org/en/latest/
exclude=\
venv*/*,\
local/*,\
docs/*,\
build/*,\
tests/apps/*,\
.eggs/*,\
.tox/*
max-line-length = 119
extend-ignore =
# whitespace before :
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
[tox]
envlist = towncrier-check,docs-lint,pre-commit,py{38,39,310,311,312},coverage
labels =
test = py{38,39,310,311,312},coverage
test38 = py38,coverage38
test39 = py39,coverage39
test310 = py310,coverage310
test311 = py311,coverage311
test312 = py312,coverage312
test-fast = py{38,39,310,311,312}-fast
test-platform = py{38,39,310,311,312},coverage-platform
ci = towncrier-check,docs-lint,pre-commit,py{38,39,310,311,312},coverage-platform
skip_missing_interpreters = True
[testenv:pre-commit]
skip_install = True
deps =
build
setuptools
wheel
commands_pre = python -m install_requirement pre-commit --extra dev --project-root "{tox_root}"
commands = pre-commit run --all-files --show-diff-on-failure --color=always
[testenv:py{,38,39,310,311,312}{,-fast}]
package = wheel
wheel_build_env = .pkg
depends: pre-commit
use_develop = fast: True
# Needed on Windows to test data directory creation
passenv = LOCALAPPDATA
setenv = COVERAGE_FILE = {env:COVERAGE_FILE:.coverage}
extras = dev
commands =
!fast : python -X warn_default_encoding -m coverage run -m pytest {posargs:-vv --color yes}
fast : python -m pytest {posargs:-vv --color yes -n auto}
[testenv:coverage{,38,39,310,311,312}{,-ci}{,-platform,-platform-linux,-platform-macos,-platform-windows,-project}{,-keep}{,-html}]
depends = py{,38,39,310,311,312}
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 =
coverage: py38,py39,py310,py311,py312
coverage38: py38
coverage39: py39
coverage310: py310
coverage311: py311
coverage312: py312
passenv = COVERAGE_FILE
setenv =
keep: COMBINE_FLAGS = --keep
# spoof platform for conditional coverage exclusions
platform-linux: COVERAGE_PLATFORM = linux
platform-macos: COVERAGE_PLATFORM = darwin
platform-windows: COVERAGE_PLATFORM = win32
# use the coverage files created in CI for individual platforms
ci-platform-linux: COVERAGE_FILE = .coverage.ubuntu
ci-platform-macos: COVERAGE_FILE = .coverage.macos
ci-platform-windows: COVERAGE_FILE = .coverage.windows
# disable conditional coverage exclusions for Python version to test entire platform
{platform,project}: COVERAGE_EXCLUDE_PYTHON_VERSION=disable
# disable conditional coverage exclusions for host platform to test entire project
project: COVERAGE_EXCLUDE_PLATFORM=disable
deps =
build
setuptools
wheel
commands_pre =
python --version
python -m install_requirement coverage coverage-conditional-plugin --extra dev --project-root "{tox_root}"
commands =
-python -m coverage combine {env:COMBINE_FLAGS}
html: python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=100
[testenv:towncrier{,-check}]
skip_install = True
deps = towncrier ~= 22.8
commands =
check : python -m towncrier.check --compare-with origin/main
!check : python -m towncrier {posargs}
[docs]
build_dir = _build
# -W: make warnings into errors
# --keep-going: continue on errors
# -j: run with multiple processes
# -n: nitpick mode
sphinx_args = -W --keep-going -j auto -n
# -v: verbose logging
# -E: force rebuild of environment
# -T: print traceback on error
# -a: read/parse all files
# -d: use tox's temp dir for caching
sphinx_args_extra = {[docs]sphinx_args} -v -E -T -a -d {envtmpdir}/doctrees
[testenv:docs{,-lint,-all}]
package = wheel
wheel_build_env = .pkg
change_dir = docs
extras = 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 : python -m sphinx {[docs]sphinx_args} -b html . {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args_extra} -b spelling . {[docs]build_dir}/spell
lint : python -m sphinx {[docs]sphinx_args_extra} -b linkcheck . {[docs]build_dir}/links
all : python -m sphinx {[docs]sphinx_args_extra} -b html . {[docs]build_dir}/html
[testenv:package{,-with-automation}]
skip_install = True
passenv = FORCE_COLOR
deps =
build==1.0.3
twine==4.0.2
commands =
python -m build . --outdir dist/
with-automation: python -m build automation/ --outdir dist/
python -m twine check dist/*