Skip to content

Commit 3d638d9

Browse files
authored
chore(deps,tooling): move dev extras to dependency-group (#1688)
1 parent 74dba4f commit 3d638d9

4 files changed

Lines changed: 163 additions & 206 deletions

File tree

packages/testing/pyproject.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ Repository = "https://github.com/ethereum/execution-specs"
6060
Issues = "https://github.com/ethereum/execution-specs/issues"
6161
Changelog = "https://eest.ethereum.org/main/CHANGELOG/"
6262

63-
[project.optional-dependencies]
64-
test = ["pytest-cov>=4.1.0,<5"]
63+
[dependency-groups]
64+
test = [
65+
"pytest-cov>=4.1.0,<5",
66+
]
6567
lint = [
6668
"ruff==0.13.2",
6769
"mypy==1.17.0",
@@ -87,6 +89,11 @@ docs = [
8789
"lxml>=6.0.0,<7", # needs to be >= 6.0 for pypy
8890
"setuptools==78.0.2",
8991
]
92+
dev = [
93+
{include-group = "test"},
94+
{include-group = "lint"},
95+
{include-group = "docs"},
96+
]
9097

9198
[project.scripts]
9299
fill = "execution_testing.cli.pytest_commands.fill:fill"

pyproject.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ dependencies = [
2626
"ethereum-types>=0.2.4,<0.3",
2727
"ethereum-rlp>=0.1.4,<0.2",
2828
"cryptography>=45.0.1,<46",
29+
"platformdirs>=4.2,<5",
30+
"libcst>=1.8,<2",
2931
]
3032

3133
[tool.setuptools.package-dir]
@@ -156,6 +158,12 @@ packages = [
156158
"ethereum_spec_tools" = ["py.typed"]
157159

158160
[project.optional-dependencies]
161+
optimized = [
162+
"rust-pyspec-glue>=0.0.9,<0.1.0",
163+
"ethash>=1.1.0,<2",
164+
]
165+
166+
[dependency-groups]
159167
test = [
160168
"pytest>=8,<9",
161169
"pytest-cov>=4.1.0,<5",
@@ -174,23 +182,16 @@ lint = [
174182
"vulture==2.14.0",
175183
"types-requests>=2.31,<2.33",
176184
]
177-
tools = [
178-
"platformdirs>=4.2,<5",
179-
"libcst>=1.8,<2",
180-
]
181185
doc = [
182186
"docc>=0.3.0,<0.4.0",
183187
"fladrif>=0.2.0,<0.3.0",
184188
"mistletoe>=1.5.0,<2",
185189
]
186-
optimized = [
187-
"rust-pyspec-glue>=0.0.9,<0.1.0",
188-
"ethash>=1.1.0,<2",
189-
]
190190
dev = [
191-
"ethereum-execution[test,lint,tools,doc]",
192-
"tox>=4.0",
193-
"tox-uv>=1.29",
191+
{include-group = "test"},
192+
{include-group = "lint"},
193+
{include-group = "doc"},
194+
"ethereum-execution[optimized]",
194195
]
195196

196197
[tool.setuptools.dynamic]

tox.ini

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
[tox]
2-
min_version = 4.0
32
requires =
4-
tox-uv >=1.29
3+
tox>=4,<5
4+
tox-uv>=1.29,<2
55
envlist = py3,pypy3,json_infra,static,tests_pytest_py3,tests_pytest_pypy3
66

77
[testenv]
88
runner = uv-venv-lock-runner
99
uv_seed = false
1010

1111
[testenv:static]
12-
extras =
13-
lint
14-
optimized
15-
test
16-
doc
1712
commands =
1813
codespell -I whitelist.txt src tests/evm_tools tests/json_infra packages
1914
ruff check src packages tests --exclude tests/fixtures
@@ -26,34 +21,30 @@ commands =
2621
[testenv:tests_pytest_py3]
2722
changedir = {toxinidir}/packages/testing
2823
package = editable
29-
extras =
30-
test
31-
lint
3224
commands =
3325
pytest \
3426
-n auto --maxprocesses 6 \
3527
--basetemp="{temp_dir}/pytest" \
3628
src
3729

3830
[testenv:tests_pytest_pypy3]
31+
# overwrite default groups (dev) to avoid installing optimized in tox envs using pypy
32+
dependency_groups =
33+
test
34+
lint # TODO: add ruff for gentest; remove as part of ethereum/execution-specs#1715
3935
passenv =
4036
PYPY_GC_MAX
4137
PYPY_GC_MIN
4238
# run inside the package directory so pytest picks up packages/testing/pyproject.toml
4339
changedir = {toxinidir}/packages/testing
4440
package = editable
45-
extras =
46-
test
47-
lint
4841
commands =
4942
pytest \
5043
-n auto --maxprocesses 6 \
5144
--basetemp="{temp_dir}/pytest" \
5245
src
5346

5447
[testenv:json_infra]
55-
extras =
56-
test
5748
commands =
5849
pytest \
5950
-m "not slow" \
@@ -69,8 +60,6 @@ commands =
6960
tests/json_infra
7061

7162
[testenv:py3]
72-
extras =
73-
test
7463
commands =
7564
fill \
7665
-m "not slow and not zkevm and not benchmark" \
@@ -81,7 +70,8 @@ commands =
8170
tests
8271

8372
[testenv:pypy3]
84-
extras =
73+
# see comment for tests_pytest_pypy3
74+
dependency_groups =
8575
test
8676
passenv =
8777
PYPY_GC_MAX
@@ -101,9 +91,6 @@ commands =
10191
tests
10292

10393
[testenv:optimized]
104-
extras =
105-
test
106-
optimized
10794
passenv =
10895
PYPY_GC_MAX
10996
PYPY_GC_MIN
@@ -120,7 +107,6 @@ commands =
120107

121108
[testenv:doc]
122109
basepython = python3
123-
extras = doc
124110
commands =
125111
docc --output "{toxworkdir}/docs"
126112
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs" / "index.html"))'

0 commit comments

Comments
 (0)