-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathtox.ini
More file actions
295 lines (272 loc) · 7.16 KB
/
tox.ini
File metadata and controls
295 lines (272 loc) · 7.16 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# Functional Python Programming 3e
#
# Each chapter is a separate environment
# to permit testing chapters individually.
#
# Some sections don't have any test functions in them.
# They're included in the list of sections, but commented out, to make it easier to confirm
# all sections are accounted for.
#
# The various chapter "demo" applications take quite a bit of time to run.
# They don't depend on a specific version of mypy.
# We collect the application demos into a separate environment, `demo`.
# the environment setting `TOX_SKIP_ENV=demo` will skip the chapter demos, speeding up a simple unit test.
#
# For general testing:
# `TOX_SKIP_ENV=demo tox`
#
# To run only the demo applications:
# tox -e demo
[tox]
skipsdist=true
envlist = ch{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16}-py3{10,11},demo
[testenv]
deps =
pytest==7.4.0
mypy==1.4.1
-rrequirements.txt
setenv =
PYTHONPATH = {toxinidir}
[testenv:ch01-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 1
pytest --doctest-modules Chapter01
pytest Chapter01/ch01_ex1.py
pytest Chapter01/ch01_ex2.py
pytest Chapter01/ch01_ex3.py
pytest Chapter01/ch01_ex4.py
mypy --strict --show-error-codes Chapter01
# python Chapter01/ch01_ex1.py
[testenv:ch02-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 2
pytest --doctest-modules Chapter02
pytest Chapter02/ch02_ex1.py
mypy --strict --show-error-codes Chapter02
# python Chapter02/ch02_ex1.py
[testenv:ch03-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 3
pytest --doctest-modules Chapter03
pytest Chapter03/ch03_ex1.py
# pytest Chapter03/ch03_ex2.py
pytest Chapter03/ch03_ex3.py
pytest Chapter03/ch03_ex4.py
pytest Chapter03/ch03_ex5.py
mypy --strict --show-error-codes Chapter03
# python Chapter03/ch03_ex1.py
[testenv:ch04-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 4
pytest --doctest-modules Chapter04
pytest Chapter04/ch04_ex1.py
# pytest Chapter04/ch04_ex2.py # No tests
pytest Chapter04/ch04_ex3.py
pytest Chapter04/ch04_ex4.py
pytest Chapter04/ch04_ex5.py
mypy --strict --show-error-codes Chapter04
# python Chapter04/ch04_ex2.py
[testenv:ch05-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 5
pytest --doctest-modules Chapter05
pytest Chapter05/ch05_ex1.py
pytest Chapter05/ch05_ex2.py
# pytest Chapter05/ch05_ex3.py # No tests
mypy --strict --show-error-codes Chapter05
# python Chapter05/ch05_ex2.py
[testenv:ch06-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 6
pytest --doctest-modules Chapter06
pytest Chapter06/ch06_ex1.py
pytest Chapter06/ch06_ex2.py
pytest Chapter06/ch06_ex3.py
pytest Chapter06/ch06_ex4.py
# pytest Chapter06/ch06_ex5.py # No tests
mypy --strict --show-error-codes Chapter06
[testenv:ch07-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 7
pytest --doctest-modules Chapter07
pytest Chapter07/ch07_ex1.py
pytest Chapter07/ch07_ex2.py
pytest Chapter07/ch07_ex3.py
pytest Chapter07/ch07_ex4.py
# pytest Chapter07/ch07_ex5.py # No tests
pytest Chapter07/ch07_ex6.py
mypy --strict --show-error-codes Chapter07
# python Chapter07/ch07_ex5.py
[testenv:ch08-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 8
pytest --doctest-modules Chapter08
pytest Chapter08/ch08_ex1.py
pytest Chapter08/ch08_ex2.py
pytest Chapter08/ch08_ex3.py
mypy --strict --show-error-codes Chapter08
[testenv:ch09-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 9
pytest --doctest-modules Chapter09
pytest Chapter09/ch09_ex1.py
# pytest Chapter09/ch09_ex2.py # No tests
pytest Chapter09/ch09_ex3.py
mypy --strict --show-error-codes Chapter09
# python Chapter09/ch09_ex1.py
# python Chapter09/ch09_ex2.py
[testenv:ch10-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 10
pytest --doctest-modules Chapter10
# pytest Chapter10/ch10_ex1.py # no tests
# pytest Chapter10/ch10_ex2.py
# pytest Chapter10/ch10_ex3.py
pytest Chapter10/ch10_ex4.py
# pytest Chapter10/ch10_ex5.py
# pytest Chapter10/ch10_ex6.py
# pytest Chapter10/ch10_flatten.py
mypy --strict --show-error-codes Chapter10
# python Chapter10/ch10_ex1.py
# python Chapter10/ch10_ex3.py
# python Chapter10/ch10_ex4.py
# python Chapter10/ch10_flatten.py
[testenv:ch11-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 11
pytest --doctest-modules Chapter11
pytest Chapter11/ch11_ex1.py
pytest Chapter11/ch11_ex3.py
mypy --strict --show-error-codes Chapter11
[testenv:ch12-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 12
pytest --doctest-modules Chapter12
pytest Chapter12/ch12_ex1.py
# pytest Chapter12/ch12_ex2.py # No Tests
mypy --strict --show-error-codes Chapter12
[testenv:ch13-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 13
pytest --doctest-modules Chapter13
# pytest Chapter13/ch13_ex1.py # No tests
pytest Chapter13/ch13_ex2.py
mypy --strict --show-error-codes Chapter13
[testenv:ch14-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
commands =
# Chapter 14
# pytest --doctest-modules Chapter14
pytest Chapter14/ch14_ex1.py
pytest Chapter14/ch14_ex2.py
mypy --strict --show-error-codes Chapter14
# python Chapter14/ch14_ex1.py
# python Chapter14/ch14_ex2.py
[testenv:ch15-py3{10,11}]
deps =
{[testenv]deps}
setenv =
{[testenv]setenv}
CH15_OPENAPIPATH={toxinidir}{/}Chapter15
commands =
# Chapter 15
pytest --doctest-modules Chapter15
pytest -m "not internet_required" Chapter15/ch15_ex1.py
pytest Chapter15/ch15_ex2.py
pytest Chapter15/ch15_ex3.py
pytest Chapter15/ch15_ex5.py
mypy --strict --show-error-codes Chapter15
[testenv:ch16-py3{10,11}]
deps =
{[testenv]deps}
# The `COLUMNS` forces a wide terminal to use the narrower
# default width that seems to be used inside PyCharm's terminal window.
# This assures consistent output from `rich` for testing purposes.
setenv =
{[testenv]setenv}
COLUMNS=80
commands =
# Chapter 16
# python -c 'import os; print("COLUMNS", os.environ["COLUMNS"])'
pytest --doctest-modules Chapter16
# pytest Chapter16/ch16_ex1.py # No Tests
# pytest Chapter16/ch16_ex2.py
pytest Chapter16/ch16_ex3.py
mypy --strict --show-error-codes Chapter16
# python Chapter16/ch16_ex2.py
[testenv:demo]
deps =
-rrequirements.txt
setenv =
{[testenv]setenv}
commands =
python Chapter01/ch01_ex1.py
python Chapter02/ch02_ex1.py
python Chapter03/ch03_ex1.py
python Chapter04/ch04_ex2.py
python Chapter05/ch05_ex2.py
python Chapter07/ch07_ex5.py
python Chapter09/ch09_ex1.py
python Chapter09/ch09_ex2.py
python Chapter10/ch10_ex1.py
python Chapter10/ch10_ex3.py
python Chapter10/ch10_ex4.py
python Chapter10/ch10_flatten.py
python Chapter14/ch14_ex1.py
python Chapter14/ch14_ex2.py
python Chapter16/ch16_ex2.py