-
Notifications
You must be signed in to change notification settings - Fork 15
/
tox.ini
76 lines (68 loc) · 2.43 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
[tox]
envlist = docker
[testenv:docker]
allowlist_externals=docker
passenv =
PYTHON_VERSION
TOXENV
setenv =
PYTHON_VERSION=3.11
TOXENV=check,py311
deps =
usedevelop = false
depends =
skip_install = true
commands =
docker build --build-arg PYTHON_VERSION={env:PYTHON_VERSION} -t ciadmin-{envname}-test -f Dockerfile.test .
docker run --rm -v {toxinidir}/src:/app/src -v {toxinidir}/tests:/app/tests -v ciadmin-{envname}-tox:/app/.tox -v {toxinidir}/build-decision:/app/build-decision ciadmin-{envname}-test {env:TOXENV}
[testenv]
depends = clean
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONPATH = {toxinidir}/tests {toxinidir}/src
usedevelop = true
deps =
-r {toxinidir}/requirements/test.txt
commands =
{posargs:py.test --cov-config=tox.ini --cov-append --cov=ciadmin --cov=tcadmin --cov=fxci --cov=build-decision --cov-report term-missing tests}
[testenv:py311-build-decision]
setenv =
PYTHON_VERSION=3.11
deps =
-r {toxinidir}/build-decision/requirements/test.txt
commands=
pip install -e {toxinidir}/build-decision/.
{posargs:py.test --cov-config=tox.ini --cov-append --cov=ciadmin --cov=tcadmin --cov=fxci --cov=build_decision --cov-report term-missing build-decision/tests}
[testenv:clean]
skip_install = true
commands = coverage erase
depends =
[testenv:report]
skip_install = true
commands = coverage report -m
depends = py311
parallel_show_output = true
[testenv:check]
skip_install = true
commands =
black --diff --check {toxinidir}/src {toxinidir}/tests {toxinidir}/build-decision/src {toxinidir}/build-decision/tests
isort --check --diff {toxinidir}/src {toxinidir}/tests {toxinidir}/build-decision/src {toxinidir}/build-decision/tests
pip-compile-multi verify
flake8 {toxinidir}/src
flake8 {toxinidir}/build-decision/src
yamllint {toxinidir}/src
# Doesn't work in Docker due to https://github.com/mgedmin/check-manifest/issues/110
# check-manifest -v {toxinidir}
[flake8]
max-line-length = 88
exclude = .ropeproject,.tox,sandbox,build
show-source = True
# flake8 doesn't differentiat the use of `:` in dictionaries vs. slices,
# whereas # black formats the a later with surrounding whitespace. This causes
# flake8 to incorrecly report E203.
# See https://black.readthedocs.io/en/stable/the_black_code_style.html#slices
# W503 is a default ignore, but gets overridden when we set this, so we need
# to add it again ourselves.
ignore = E203,E231,E741,W503
[coverage:run]
branch = true