-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathtox.ini
151 lines (135 loc) · 5.28 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
[tox]
# Get a description of all available environments with `uvx --with=tox-uv tox -av`
env_list =
lint
typecheck
markdownlint
spellcheck
pytest
tests-deployed
mkdocs
[testenv]
runner = uv-venv-lock-runner
package = wheel
wheel_build_env = .pkg
solc_version = 0.8.24
python_source_dirs = src tests docs .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 --diff {[testenv]python_source_dirs}
[testenv:typecheck]
description = Run type checking (mypy)
extras = lint
commands = mypy {[testenv]python_source_dirs}
[testenv:spellcheck]
description = Spellcheck documentation (pyspelling)
extras = docs
commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.pyspelling()"
[testenv:markdownlint]
description = Lint markdown files (markdownlint)
extras = docs
commands = python -c "import src.cli.tox_helpers; src.cli.tox_helpers.markdownlint()"
[testenv:mkdocs]
description = Build documentation in strict mode (mkdocs)
extras = docs
setenv =
SPEC_TESTS_AUTO_GENERATE_FILES = true
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 = 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:}
extras = test
commands_pre = solc-select use {[testenv]solc_version} --always-install
commands =
pytest -c ./pytest-framework.ini -n auto -m "not run_in_serial"
pytest -c ./pytest-framework.ini -m run_in_serial
[forks]
develop = Prague
eip7692 = Osaka
[testenv:tests-deployed]
description = Fill test cases in ./tests/ for deployed 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_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto -k "not slow" --skip-evm-dump
[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_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto --until={[forks]develop} -k "not slow" --skip-evm-dump
[testenv:tests-eip7692]
description = Fill test cases in ./tests/ for EIP-7692 (EOF) on Osaka
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
commands_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto --evm-bin=evmone-t8n --fork={[forks]eip7692} -k "not slow" ./tests/osaka --skip-evm-dump
# ----------------------------------------------------------------------------------------------
# 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}
setenv =
{[testenv:pytest]setenv}
commands_pre =
{[testenv:tests-deployed]:commands_pre}
commands =
{[testenv:lint]commands}
{[testenv:typecheck]commands}
{[testenv:spellcheck]commands}
{[testenv:tests-deployed]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}