forked from ethereum/lahja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
92 lines (84 loc) · 3.71 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
[tox]
envlist=
py{36,37}-examples
py{36,37}-core-{asyncio,trio,common,driver}
py{36,37}-snappy-core-{asyncio,trio,common,driver}
lint
docs
[isort]
force_sort_within_sections=True
known_third_party=hypothesis,pytest,async_generator,cytoolz,trio_typing,pytest_trio
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
[flake8]
max-line-length= 100
exclude= venv*,.tox,docs,build
# flake8 has a different opinion on line breaks than black
ignore= W503
[testenv]
usedevelop=True
commands=
driver: pytest {posargs:tests/core/driver}
common: pytest {posargs:tests/core/common}
asyncio: pytest {posargs:tests/core/asyncio}
examples: pytest {posargs:tests/examples}
trio: pytest {posargs:tests/core/trio}
docs: make validate-docs
basepython =
docs: python
py36: python3.6
py37: python3.7
extras=
test
asyncio: test-asyncio
driver: test-asyncio
examples: test-asyncio
trio: test-trio
docs: doc
py36-snappy: snappy
py37-snappy: snappy
whitelist_externals=
make
bash
[testenv:benchmark]
basepython=python
commands=
# 10 processes with different number of events propagated
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 10 --num-events 10000 --backend asyncio --backend trio"
# Throttling the events slightly increases overall time but drastically reduces the average propagation time
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 10 --num-events 10000 --throttle 0.001 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 10 --num-events 100 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 10 --num-events 10 --backend asyncio --backend trio"
# 3 processes, same number of events propagated
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 10000 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 10000 --throttle 0.001 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 100 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 10 --backend asyncio --backend trio"
# With 1Mb payload, max 1000 events
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 1000 --throttle 0.001 --payload-bytes 1000000 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 100 --payload-bytes 1000000 --backend asyncio --backend trio"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 10 --payload-bytes 1000000 --backend asyncio --backend trio"
# request/response
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 1000 --mode request"
bash -c "python {toxinidir}/scripts/perf_benchmark.py --num-processes 3 --num-events 100 --mode request"
[testenv:snappy-benchmark]
usedevelop=True
commands=
{[testenv:benchmark]commands}
basepython =
{[testenv:benchmark]basepython}
extras=
snappy
[testenv:lint]
basepython=python
extras=lint
commands=
flake8 {toxinidir}/lahja {toxinidir}/tests setup.py
mypy -p lahja --config-file {toxinidir}/mypy.ini
mypy {toxinidir}/tests/mypy_typing_test.py --config-file {toxinidir}/mypy.ini
isort --recursive --check-only --diff {toxinidir}/lahja {toxinidir}/tests
pydocstyle {toxinidir}/lahja {toxinidir}/tests
black --check {toxinidir}/lahja {toxinidir}/scripts {toxinidir}/tests