forked from mozilla-releng/scriptworker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
73 lines (64 loc) · 2.07 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
[tox]
envlist = docker
[testenv:docker]
whitelist_externals=docker
deps =
usedevelop = false
depends =
skip_install = true
commands =
docker build --build-arg PYTHON_VERSION=3.7 --build-arg PYTHON_REQ_SUFFIX=.py37 -t bouncerscript-{envname}-py37-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v bouncerscript-{envname}-py37-tox:/app/.tox bouncerscript-{envname}-py37-test py37
docker build --build-arg PYTHON_VERSION=3.8 -t bouncerscript-{envname}-py38-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v bouncerscript-{envname}-py38-tox:/app/.tox bouncerscript-{envname}-py38-test py38,check
[testenv]
recreate = True
setenv =
PYTHONDONTWRITEBYTECODE=1
usedevelop = true
deps =
check: -r requirements/test.txt
py37: -r requirements/test.py37.txt
py38: -r requirements/test.txt
commands=
{posargs:py.test --cov-config=tox.ini --cov-append --cov={toxinidir}/src/bouncerscript --cov-report term-missing tests}
[testenv:clean]
skip_install = true
commands = coverage erase
depends =
[testenv:report]
skip_install = true
commands = coverage report -m
depends = py38
parallel_show_output = true
[testenv:check]
skip_install = true
ignore_errors = true
commands =
black --diff --check {toxinidir}
isort --check --diff {toxinidir}
pip-compile-multi verify
flake8 {toxinidir}
# Doesn't work without a .git in the same directory
# check-manifest -v {toxinidir}
[testenv:coveralls]
deps=
python-coveralls
coverage>=4.2
commands=
coveralls
[flake8]
max-line-length = 180
exclude = .ropeproject,.tox,sandbox
show-source = True
# flake8 doesn't differentiate 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,W503
[pytest]
norecursedirs = .tox .git .hg sandbox build
python_files = test_*.py
addopts = -vv -s --color=yes