forked from ethereum/execution-spec-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
164 lines (146 loc) · 5.66 KB
/
tox.ini
File metadata and controls
164 lines (146 loc) · 5.66 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
[tox]
# Get a description of all available environments with `uvx --with=tox-uv tox -av`
env_list =
lint
typecheck
markdownlint
spellcheck
pytest
tests-deployed
tests-deployed-benchmark
mkdocs
[testenv]
runner = uv-venv-lock-runner
package = editable
wheel_build_env = .pkg
solc_version = 0.8.24
python_source_dirs = src tests .github/scripts
[testenv:lint]
description = Lint and code formatting checks (ruff)
extras = lint
commands =
ruff check --no-fix --show-fixes {[testenv]python_source_dirs}
ruff format --check {[testenv]python_source_dirs}
# The following ensures docstring and comment line length is checked to 79 characters
# see https://github.com/ethereum/execution-spec-tests/issues/2134
ruff check --select W505 --config 'lint.pycodestyle.max-doc-length = 79' {[testenv]python_source_dirs}
[testenv:typecheck]
description = Run type checking (mypy)
extras = lint
commands = mypy {[testenv]python_source_dirs}
[testenv:spellcheck]
description = Spellcheck code and documentation (codespell)
extras = docs
passenv =
GITHUB_ACTIONS
GITHUB_STEP_SUMMARY
commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.codespell()"
[testenv:markdownlint]
description = Lint markdown files (markdownlint)
extras = docs
commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.markdownlint()"
[testenv:changelog]
description = Validate changelog entries (changelog)
extras = docs
commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.validate_changelog()"
[testenv:mkdocs]
description = Build documentation in strict mode (mkdocs)
extras = docs,lint
setenv =
GEN_TEST_DOC_VERSION = "tox"
# Required for `cairosvg` so tox can find `libcairo-2`.
# https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/?h=cairo#cairo-library-was-not-found
DYLD_FALLBACK_LIBRARY_PATH = /opt/homebrew/lib
commands =
ruff check --no-fix --show-fixes docs/scripts
ruff format --check docs/scripts
mkdocs build --strict
[testenv:pytest]
description = Run library and framework unit tests (pytest)
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
CI = {env:CI:}
extras =
test
lint # Required `gentest` for formatting tests
commands =
pytest -n auto
[forks]
develop = Osaka
eip7692 = EOFv1
[testenv:tests-deployed]
description = Fill test cases in ./tests/ for deployed mainnet forks, except for slow/benchmark tests.
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
commands = fill -n auto -m "not slow" --output=/tmp/fixtures-tox --clean
[testenv:tests-deployed-benchmark]
description = Fill benchmarking test cases in ./tests/ for deployed mainnet forks, using evmone-t8n.
commands = fill -n auto -m "benchmark" --gas-benchmark-values 5 --output=/tmp/fixtures-tox --clean --evm-bin=evmone-t8n --from=Prague
[testenv:tests-develop]
description = Fill test cases in ./tests/ for deployed and development mainnet forks
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
commands = fill -n auto --until={[forks]develop} -k "not slow" --output=/tmp/fixtures-tox --clean
# ----------------------------------------------------------------------------------------------
# ALIAS ENVIRONMENTS
# ----------------------------------------------------------------------------------------------
# For convenience/backwards compatibility. Using -e with a list of environments is preferred due
# to clearer output and better parallelization, e.g.
# uvx --with=tox-uv tox -e lint,typecheck,spellcheck,pytest
# ----------------------------------------------------------------------------------------------
# ALIAS that runs checks on ./src/: lint, typecheck, spellcheck, pytest
# uvx --with=tox-uv tox -e lint,typecheck,spellcheck,pytest
[testenv:framework]
description = Alias that runs lint, typecheck, spellcheck, pytest.
extras =
{[testenv:lint]extras}
{[testenv:typecheck]extras}
{[testenv:spellcheck]extras}
{[testenv:pytest]extras}
setenv =
{[testenv:pytest]setenv}
commands_pre =
{[testenv:pytest]:commands_pre}
commands =
{[testenv:lint]commands}
{[testenv:typecheck]commands}
{[testenv:spellcheck]commands}
{[testenv:pytest]commands}
# ALIAS that runs checks on ./tests/: lint, typecheck, spellcheck, tests-deployed
# uvx --with=tox-uv tox -e lint,typecheck,spellcheck,tests-deployed
[testenv:tests]
description = Alias that runs lint, typecheck, spellcheck, tests-deployed
extras =
{[testenv:lint]extras}
{[testenv:typecheck]extras}
{[testenv:spellcheck]extras}
{[testenv:tests-deployed]extras}
{[testenv:tests-deployed-benchmark]extras}
setenv =
{[testenv:pytest]setenv}
commands_pre =
{[testenv:tests-deployed]:commands_pre}
{[testenv:tests-deployed-benchmark]:commands_pre}
commands =
{[testenv:lint]commands}
{[testenv:typecheck]commands}
{[testenv:spellcheck]commands}
{[testenv:tests-deployed]commands}
{[testenv:tests-deployed-benchmark]commands}
# ALIAS that runs checks on ./docs/: spellcheck, markdownlint, mkdocs
# uvx --with=tox-uv tox -e spellcheck,markdownlint,mkdocs
[testenv:docs]
description = Alias that runs all documentation checks (spellcheck, markdownlint, mkdocs).
extras =
{[testenv:spellcheck]extras}
{[testenv:markdownlint]extras}
{[testenv:mkdocs]extras}
setenv =
{[testenv:mkdocs]setenv}
commands =
{[testenv:spellcheck]commands}
{[testenv:markdownlint]commands}
{[testenv:mkdocs]commands}