forked from redis/redis-py
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
379 lines (348 loc) · 12.4 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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
[pytest]
addopts = -s
markers =
redismod: run only the redis module tests
pipeline: pipeline tests
onlycluster: marks tests to be run only with cluster mode redis
onlynoncluster: marks tests to be run only with standalone redis
ssl: marker for only the ssl tests
asyncio: marker for async tests
replica: replica tests
experimental: run only experimental tests
asyncio_mode = auto
[tox]
minversion = 3.2.0
requires = tox-docker
envlist = {standalone,cluster}-{plain,hiredis,ocsp}-{uvloop,asyncio}-{py37,py38,py39,pypy3},linters,docs
[docker:master]
name = master
image = redisfab/redis-py:6.2.6
ports =
6379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6379)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis6.2/master/redis.conf:/redis.conf
[docker:replica]
name = replica
image = redisfab/redis-py:6.2.6
links =
master:master
ports =
6380:6380/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6380)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis6.2/replica/redis.conf:/redis.conf
[docker:unstable]
name = unstable
image = redisfab/redis-py:unstable
ports =
6378:6378/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6378)) else False"
volumes =
bind:rw:{toxinidir}/docker/unstable/redis.conf:/redis.conf
[docker:unstable_cluster]
name = unstable_cluster
image = redisfab/redis-py-cluster:unstable
ports =
6372:6372/tcp
6373:6373/tcp
6374:6374/tcp
6375:6375/tcp
6376:6376/tcp
6377:6377/tcp
healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(6372,6377)]) else False"
volumes =
bind:rw:{toxinidir}/docker/unstable_cluster/redis.conf:/redis.conf
[docker:sentinel_1]
name = sentinel_1
image = redisfab/redis-py-sentinel:6.2.6
links =
master:master
ports =
26379:26379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_1.conf:/sentinel.conf
[docker:sentinel_2]
name = sentinel_2
image = redisfab/redis-py-sentinel:6.2.6
links =
master:master
ports =
26380:26380/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_2.conf:/sentinel.conf
[docker:sentinel_3]
name = sentinel_3
image = redisfab/redis-py-sentinel:6.2.6
links =
master:master
ports =
26381:26381/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_3.conf:/sentinel.conf
[docker:redis_stack]
name = redis_stack
image = redis/redis-stack-server:edge
ports =
36379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',36379)) else False"
[docker:redis_cluster]
name = redis_cluster
image = redisfab/redis-py-cluster:6.2.6
ports =
16379:16379/tcp
16380:16380/tcp
16381:16381/tcp
16382:16382/tcp
16383:16383/tcp
16384:16384/tcp
healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16379,16384)]) else False"
volumes =
bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf
[docker:redismod_cluster]
name = redismod_cluster
image = redisfab/redis-py-modcluster:edge
ports =
46379:46379/tcp
46380:46380/tcp
46381:46381/tcp
46382:46382/tcp
46383:46383/tcp
46384:46384/tcp
healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(46379,46384)]) else False"
volumes =
bind:rw:{toxinidir}/docker/redismod_cluster/redis.conf:/redis.conf
[docker:stunnel]
name = stunnel
image = redisfab/stunnel:latest
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6666)) else False"
links =
master:master
ports =
6666:6666/tcp
volumes =
bind:ro:{toxinidir}/docker/stunnel/conf:/etc/stunnel/conf.d
bind:ro:{toxinidir}/docker/stunnel/keys:/etc/stunnel/keys
[docker:redis5_master]
name = redis5_master
image = redisfab/redis-py:5.0-buster
ports =
6382:6382/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6382)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis5/master/redis.conf:/redis.conf
[docker:redis5_replica]
name = redis5_replica
image = redisfab/redis-py:5.0-buster
links =
redis5_master:redis5_master
ports =
6383:6383/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6383)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis5/replica/redis.conf:/redis.conf
[docker:redis5_sentinel_1]
name = redis5_sentinel_1
image = redisfab/redis-py-sentinel:5.0-buster
links =
redis5_master:redis5_master
ports =
26382:26382/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26382)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_1.conf:/sentinel.conf
[docker:redis5_sentinel_2]
name = redis5_sentinel_2
image = redisfab/redis-py-sentinel:5.0-buster
links =
redis5_master:redis5_master
ports =
26383:26383/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26383)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_2.conf:/sentinel.conf
[docker:redis5_sentinel_3]
name = redis5_sentinel_3
image = redisfab/redis-py-sentinel:5.0-buster
links =
redis5_master:redis5_master
ports =
26384:26384/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26384)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_3.conf:/sentinel.conf
[docker:redis5_cluster]
name = redis5_cluster
image = redisfab/redis-py-cluster:5.0-buster
ports =
16385:16385/tcp
16386:16386/tcp
16387:16387/tcp
16388:16388/tcp
16389:16389/tcp
16390:16390/tcp
healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16385,16390)]) else False"
volumes =
bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf
[docker:redis4_master]
name = redis4_master
image = redisfab/redis-py:4.0-buster
ports =
6381:6381/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6381)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis4/master/redis.conf:/redis.conf
[docker:redis4_sentinel_1]
name = redis4_sentinel_1
image = redisfab/redis-py-sentinel:4.0-buster
links =
redis4_master:redis4_master
ports =
26385:26385/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26385)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_1.conf:/sentinel.conf
[docker:redis4_sentinel_2]
name = redis4_sentinel_2
image = redisfab/redis-py-sentinel:4.0-buster
links =
redis4_master:redis4_master
ports =
26386:26386/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26386)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_2.conf:/sentinel.conf
[docker:redis4_sentinel_3]
name = redis4_sentinel_3
image = redisfab/redis-py-sentinel:4.0-buster
links =
redis4_master:redis4_master
ports =
26387:26387/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26387)) else False"
volumes =
bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_3.conf:/sentinel.conf
[docker:redis4_cluster]
name = redis4_cluster
image = redisfab/redis-py-cluster:4.0-buster
ports =
16391:16391/tcp
16392:16392/tcp
16393:16393/tcp
16394:16394/tcp
16395:16395/tcp
16396:16396/tcp
healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16391,16396)]) else False"
volumes =
bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf
[isort]
profile = black
multi_line_output = 3
[testenv]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/dev_requirements.txt
docker =
unstable
unstable_cluster
master
replica
sentinel_1
sentinel_2
sentinel_3
redis_cluster
redis_stack
stunnel
extras =
hiredis: hiredis
ocsp: cryptography, pyopenssl, requests
setenv =
CLUSTER_URL = "redis://localhost:16379/0"
UNSTABLE_CLUSTER_URL = "redis://localhost:6372/0"
commands =
standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml {posargs}
standalone-uvloop: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-uvloop-results.xml --uvloop {posargs}
cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} --redis-unstable-url={env:UNSTABLE_CLUSTER_URL:} --junit-xml=cluster-results.xml {posargs}
cluster-uvloop: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} --redis-unstable-url={env:UNSTABLE_CLUSTER_URL:} --junit-xml=cluster-uvloop-results.xml --uvloop {posargs}
[testenv:redis5]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/dev_requirements.txt
docker =
redis5_master
redis5_replica
redis5_sentinel_1
redis5_sentinel_2
redis5_sentinel_3
redis5_cluster
extras =
hiredis: hiredis
cryptography: cryptography, requests
setenv =
CLUSTER_URL = "redis://localhost:16385/0"
commands =
standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs}
cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs}
[testenv:redis4]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/dev_requirements.txt
docker =
redis4_master
redis4_sentinel_1
redis4_sentinel_2
redis4_sentinel_3
redis4_cluster
extras =
hiredis: hiredis
cryptography: cryptography, requests
setenv =
CLUSTER_URL = "redis://localhost:16391/0"
commands =
standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs}
cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs}
[testenv:devenv]
skipsdist = true
skip_install = true
deps = -r {toxinidir}/dev_requirements.txt
docker = {[testenv]docker}
[testenv:linters]
deps_files = dev_requirements.txt
docker =
commands =
flake8
black --target-version py37 --check --diff .
isort --check-only --diff .
vulture redis whitelist.py --min-confidence 80
flynt --fail-on-change --dry-run .
skipsdist = true
skip_install = true
[testenv:docs]
deps = -r docs/requirements.txt
docker =
changedir = {toxinidir}/docs
allowlist_externals = make
commands = make html
[flake8]
max-line-length = 88
exclude =
*.egg-info,
*.pyc,
.git,
.tox,
.venv*,
build,
docs/*,
dist,
docker,
venv*,
.venv*,
whitelist.py
ignore =
F405
W503
E203
E126