-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathtox.ini
82 lines (75 loc) · 2.58 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
[tox]
envlist = docker
[testenv:docker]
whitelist_externals=docker
passenv =
PYTHON_VERSION
TOXENV
setenv =
PYTHON_VERSION=3.12
# TODO: not sure how to test multiple versions in the same invocation
TOXENV=check,py38,py39,py310,py311,py312
deps =
usedevelop = false
depends =
skip_install = true
ignore_errors = true
commands =
docker build --build-arg PYTHON_VERSION=3.12 -t redo-{envname}-py312-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v redo-{envname}-py312-tox:/app/.tox redo-{envname}-py312-test check,py312
docker build --build-arg PYTHON_VERSION=3.11 -t redo-{envname}-py311-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v redo-{envname}-py311-tox:/app/.tox redo-{envname}-py311-test py311
docker build --build-arg PYTHON_VERSION=3.10 -t redo-{envname}-py310-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v redo-{envname}-py310-tox:/app/.tox redo-{envname}-py310-test py310
docker build --build-arg PYTHON_VERSION=3.9 -t redo-{envname}-py39-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v redo-{envname}-py39-tox:/app/.tox redo-{envname}-py39-test py39
docker build --build-arg PYTHON_VERSION=3.8 -t redo-{envname}-py38-test -f Dockerfile.test .
docker run --rm -v {toxinidir}:/app -v redo-{envname}-py38-tox:/app/.tox redo-{envname}-py38-test py38
[testenv]
depends = clean
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONPATH = {toxinidir}/tests
usedevelop = true
deps =
mock
pytest
pytest-cov
commands =
{posargs:py.test --cov-config=tox.ini --cov-append --cov=redo --cov-report term-missing tests}
[testenv:clean]
skip_install = true
commands = coverage erase
depends =
[testenv:report]
skip_install = true
commands = coverage report -m
depends = py37
parallel_show_output = true
[testenv:check]
skip_install = true
deps =
black
isort
pip-compile-multi
flake8
check-manifest
commands =
black --check {toxinidir}
isort --check -rc -df {toxinidir}
pip-compile-multi verify
flake8 {toxinidir}
check-manifest -v {toxinidir}
[flake8]
max-line-length = 160
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,E741,W503
[coverage:run]
branch = true