-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
105 lines (90 loc) · 3.49 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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
isolated_build = true
allowlist_externals = poetry
skipsdist = true
envlist = setup, update, format, py310, indent, sort, dataclass, numpy, latency-dumps, latency-loads, latency-empty, memory
[main]
dataclass_dir = doc/types/dataclass
indent_dir = doc/indent
latency_dumps_dir = doc/latency/dumps
latency_empty_dir = doc/latency/empty
latency_loads_dir = doc/latency/loads
memory_dir = doc/memory
numpy_dir = doc/types/numpy
sort_dir = doc/sort
[pytest]
minversion = 7.0
addopts = --verbose --benchmark-min-time=1 --benchmark-max-time=5 --benchmark-disable-gc --benchmark-autosave --benchmark-save-data --random-order
[testenv]
allowlist_externals = poetry
commands = poetry run pytest
envdir = {toxinidir}/.tox/.toxenv
passenv = *
[testenv:dataclass]
commands =
- poetry run pytest \
--benchmark-histogram={[main]dataclass_dir}/image \
--benchmark-json={[main]dataclass_dir}/benchmark.json \
orjson_benchmark/benchmark_dataclass.py
poetry run graph-tabulate {[main]dataclass_dir}/benchmark.json
[testenv:format]
commands =
poetry run autoflake --in-place --recursive \
--remove-all-unused-imports --ignore-init-module-imports .
poetry run isort orjson_benchmark tests
poetry run black -l 120 orjson_benchmark tests
[testenv:indent]
commands =
- poetry run pytest \
--benchmark-histogram={[main]indent_dir}/image \
--benchmark-json={[main]indent_dir}/benchmark.json \
orjson_benchmark/benchmark_indent.py
poetry run graph-tabulate {[main]indent_dir}/benchmark.json
[testenv:latency-dumps]
commands =
poetry run pytest \
--benchmark-histogram={[main]latency_dumps_dir}/image \
--benchmark-json={[main]latency_dumps_dir}/benchmark.json \
orjson_benchmark/benchmark_latency.py -k test_dumps
poetry run graph-tabulate {[main]latency_dumps_dir}/benchmark.json
[testenv:latency-empty]
commands =
poetry run pytest \
--benchmark-histogram={[main]latency_empty_dir}/image \
--benchmark-json={[main]latency_empty_dir}/benchmark.json \
orjson_benchmark/benchmark_latency.py -k test_empty
poetry run graph-tabulate {[main]latency_empty_dir}/benchmark.json
[testenv:latency-loads]
commands =
poetry run pytest \
--benchmark-histogram={[main]latency_loads_dir}/image \
--benchmark-json={[main]latency_loads_dir}/benchmark.json \
orjson_benchmark/benchmark_latency.py -k test_loads
poetry run graph-tabulate {[main]latency_loads_dir}/benchmark.json
[testenv:memory]
commands =
poetry run pytest --capture=no orjson_benchmark/benchmark_memory.py
[testenv:numpy]
commands =
- poetry run pytest \
--benchmark-histogram={[main]numpy_dir}/image_loads \
--benchmark-json={[main]numpy_dir}/benchmark.json \
orjson_benchmark/benchmark_numpy.py
poetry run graph-tabulate {[main]numpy_dir}/benchmark.json
[testenv:setup]
commands =
poetry install --remove-untracked
poetry run setup-docs
[testenv:sort]
commands =
poetry run pytest \
--benchmark-histogram={[main]sort_dir}/image \
--benchmark-json={[main]sort_dir}/benchmark.json \
orjson_benchmark/benchmark_sorting.py
poetry run graph-tabulate {[main]sort_dir}/benchmark.json
[testenv:update]
commands = poetry update