-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
109 lines (103 loc) · 2.88 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
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 4.6.3
envlist =
lint
py
py-devel
pkg
skipsdist = True
isolated_build = True
[testenv]
description =
Unit testing
usedevelop = True
commands_pre =
sh -c "rm -f .tox/.coverage.* 2>/dev/null || true"
commands =
pytest --collect-only
# Do not use PYTEST_REQPASS as here, read README.md for details
sh -c "PYTEST_REQPASS=4 coverage run -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s}"
# We want to fail if result code is zero:
sh -c "PYTEST_REQPASS=100 pytest >/dev/null && exit 1 || true"
sh -c "coverage combine -a -q --data-file=.coverage .tox/.coverage.*"
sh -c "COVERAGE_FILE=.coverage python3 -m coverage report"
deps =
-e .[test]
devel: git+https://github.com/pytest-dev/pytest.git
extras =
test
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
PIP_DISABLE_PIP_VERSION_CHECK=1
PRE_COMMIT_COLOR=always
PY_COLORS={env:PY_COLORS:1}
PYTHONDONTWRITEBYTECODE=1
PIP_CONSTRAINT={toxinidir}/requirements.txt
devel: PIP_CONSTRAINT=/dev/null
passenv =
CI
CURL_CA_BUNDLE
DOCKER_*
HOME
PYTEST*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TOXENV
TWINE_*
allowlist_externals =
sh
rm
[testenv:lint]
description = Performs linting, style checks, metadata-validation, packaging
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a
[testenv:pkg]
description =
Validate that we can install the wheel w/ or w/o extras on Ubuntu, Debian,
Fedora, RHEL 8 and CentOS 7 by using containers.
deps =
build
twine
commands =
sh -c "rm -rf {toxinidir}/dist/ && mkdir -p {toxinidir}/dist/"
python -m build --outdir {toxinidir}/dist/
sh -c "twine check --strict dist/*"
[testenv:deps]
description = Bump all test dependencies
# we reuse the lint environment
envdir = {toxworkdir}/lint
skip_install = true
basepython = python3.9
deps =
{[testenv:lint]deps}
setenv =
# without his upgrade would likely not do anything
PIP_CONSTRAINT = /dev/null
commands =
pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
pre-commit run --all-files --show-diff-on-failure --hook-stage manual schemas
# Update pre-commit hooks
pre-commit autoupdate
# We fail if files are modified at the end
git diff --exit-code
[testenv:coverage]
description = Combines and displays coverage results
skip_install = true
usedevelop = false
setenv =
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
commands_pre =
commands =
python3 -m coverage --version
# needed by codecov github actions, also ignored result to reach report one.
python3 -m coverage xml --fail-under=0
# just for humans running it:
python3 -m coverage report
deps =
coverage[toml]>=7.0.5