-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
87 lines (84 loc) · 2.41 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
# spell-checker:ignore linkcheck basepython changedir envdir envlist envname envsitepackagesdir passenv setenv testenv toxinidir toxworkdir usedevelop doctrees envpython posargs minversion showlocals REQPASS PYTHONPYCACHEPREFIX PYTHONIOENCODING PYTHONBREAKPOINT
[tox]
minversion = 4.21.2
envlist =
lint
py
isolated_build = true
skip_missing_interpreters = True
requires =
tox >= 4.21.2
tox-extra >= 2.0.2
tox-uv >= 1.15.0
setuptools >= 65.3.0 # editable installs
[testenv]
description =
Run the tests under {basepython}
extras =
test
commands_pre =
sh -c "rm -f {envdir}/.coverage.* 2>/dev/null || true"
# safety measure to assure we do not accidentally run tests with broken dependencies
uv pip check
commands =
coverage run -m pytest {posargs:\
-v \
-n 0 \
-ra \
--showlocals \
--doctest-modules \
--durations=10 \
}
; {py,py310,py311,py312,py313}: sh -c "coverage combine -a -q --data-file={envdir}/.coverage {toxworkdir}/*/.coverage.* && coverage xml --data-file={envdir}/.coverage -o {envdir}/coverage.xml --fail-under=0"
passenv =
CURL_CA_BUNDLE # https proxies, https://github.com/tox-dev/tox/issues/1437
FORCE_COLOR
HOME
NO_COLOR
PYTEST_* # allows developer to define their own preferences
PYTEST_REQPASS # needed for CI
PYTHON* # PYTHONPYCACHEPREFIX, PYTHONIOENCODING, PYTHONBREAKPOINT,...
PY_COLORS
RTD_TOKEN
REQUESTS_CA_BUNDLE # https proxies
SETUPTOOLS_SCM_DEBUG
SSL_CERT_FILE # https proxies
SSH_AUTH_SOCK # may be needed by git
LANG
LC_*
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{envdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
; PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
FORCE_COLOR = 1
allowlist_externals =
bash
find
git
pwd
rm
sh
tox
# https://tox.wiki/en/latest/upgrading.html#editable-mode
package = editable
[testenv:lint]
description = Run all linters
# pip compile includes python version in output constraints, so we want to
# be sure that version does not change randomly.
basepython = python3.10
deps =
pre-commit>=2.6.0
setuptools>=51.1.1
skip_install = true
commands_pre =
commands =
{envpython} -m pre_commit run --all-files --show-diff-on-failure {posargs:}
passenv =
{[testenv]passenv}
PRE_COMMIT_HOME
setenv =
{[testenv]setenv}
# avoid messing pre-commit with out own constraints
PIP_CONSTRAINT=