forked from hynek/structlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
143 lines (112 loc) · 3.1 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[flake8]
ignore = E203,W503,W504
# Keep docs in sync with docs env and .readthedocs.yml.
# We don't run pre-commit in CI, because we use pre-commit.ci.
[gh-actions]
python =
3.7: py37 # mypy on 3.7 fails but there's nothing we can do about it
3.8: py38, mypy
3.9: py39, mypy
3.10: py310, mypy, cogCheck, docs
[tox]
envlist = pre-commit,mypy,cogCheck,cog,{py37,py38,py39,py310}-threads,py39-greenlets,py39-colorama,py310-be,py310-rich,docs,pypi-description,coverage-report
isolated_build = True
[testenv:docs]
# Keep basepython in sync with gh-actions and .readthedocs.yml.
basepython = python3.10
extras =
docs
passenv = TERM
setenv =
PYTHONHASHSEED = 0
commands =
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
[testenv:pre-commit]
basepython = python3.10
skip_install = true
deps = pre-commit
passenv = HOMEPATH # needed on Windows
commands = pre-commit run --all-files
[testenv:mypy]
description = Check types
extras = tests
# Need twisted & rich for stubs.
# Otherwise mypy fails in tox.
deps =
mypy
rich
twisted
commands = mypy src typing_examples.py
[testenv:cog]
description = "Update pyproject.toml's metadata"
skip_install = true
deps =
cogapp>=3.3.0
tomli
commands = python -m cogapp -rP pyproject.toml
[testenv:cogCheck]
description = "Ensure pyproject.toml is up to date"
basepython = python3.10
skip_install = true
deps = {[testenv:cog]deps}
commands = python -m cogapp --check -P pyproject.toml
[testenv]
extras = tests
deps =
threads,colorama: twisted
setenv =
PYTHONHASHSEED = 0
commands = python -m pytest {posargs}
# For missing types
[testenv:py37-threads]
deps = twisted
setenv =
PYTHONHASHSEED = 0
commands =
python -m coverage run -m pytest {posargs}
[testenv:py310-threads]
deps = twisted
setenv =
PYTHONHASHSEED = 0
commands =
python -m coverage run -m pytest {posargs}
python -OO -m coverage run -m pytest tests/test_optimized.py
[testenv:py39-greenlets]
deps =
greenlet
twisted
setenv =
PYTHONHASHSEED = 0
commands = python -m coverage run -m pytest {posargs}
[testenv:py39-colorama]
deps = colorama
commands = python -m coverage run -m pytest tests/test_dev.py {posargs}
[testenv:py310-be]
deps = better-exceptions
commands = python -m coverage run -m pytest tests/test_dev.py {posargs}
[testenv:py310-rich]
deps = rich
commands = python -m coverage run -m pytest tests/test_dev.py {posargs}
[testenv:coverage-report]
basepython = python3.10
deps = coverage[toml]
skip_install = true
parallel_show_output = true
depends = py37-threads,py310-threads,py39-greenlets,py39-colorama,py310-be,py310-rich
commands =
python -m coverage combine
python -m coverage report
[testenv:pypi-description]
basepython = python3.10
skip_install = true
deps =
twine
pip >= 18.0.0
# Needs to run last, otherwise we have a race condition about coverage files
# lying around.
depends = coverage-report
commands =
pip install --upgrade pip
pip wheel -w {envtmpdir}/build --no-deps .
twine check {envtmpdir}/build/*