Skip to content

Commit 9184a03

Browse files
kclowesdanceratopz
andauthored
feat(ci): pypy3.11 support (#1854)
* feat(ci): pypy3.11 support * chore(ci): add extra deps for linux and hive server Co-authored-by: danceratopz <[email protected]> * Remove pypy run from fill --------- Co-authored-by: danceratopz <[email protected]>
1 parent 639c6cf commit 9184a03

File tree

7 files changed

+29
-12
lines changed

7 files changed

+29
-12
lines changed

.github/workflows/tox_verify.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ jobs:
113113
include:
114114
- os: macos-15
115115
python: "3.11"
116+
- os: macos-15
117+
python: "pypy3.11"
116118
- os: ubuntu-latest
117119
python: "3.12"
118120
steps:
@@ -192,6 +194,8 @@ jobs:
192194
python: "3.11"
193195
- os: macos-15
194196
python: "3.12"
197+
- os: ubuntu-latest
198+
python: "pypy3.11"
195199
steps:
196200
- name: Checkout ethereum/execution-spec-tests
197201
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Users can select any of the artifacts depending on their testing needs for their
9090

9191
### 📋 Misc
9292

93+
- ✨ Add pypy3.11 support ([#1854](https://github.com/ethereum/execution-spec-tests/pull/1854)).
9394
- 🔀 Use only relative imports in `tests/` directory ([#1848](https://github.com/ethereum/execution-spec-tests/pull/1848)).
9495
- 🔀 Convert absolute imports to relative imports in `src/` directory for better code maintainability ([#1907](https://github.com/ethereum/execution-spec-tests/pull/1907)).
9596
- 🔀 Misc. doc updates, including a navigation footer ([#1846](https://github.com/ethereum/execution-spec-tests/pull/1846)).

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
"coincurve>=20.0.0,<21",
3737
"trie>=3.1.0,<4",
3838
"semver>=3.0.1,<4",
39-
"pydantic>=2.10.0,<3",
39+
"pydantic>=2.11.0,<3",
4040
"rich>=13.7.0,<14",
4141
"filelock>=3.15.1,<4",
4242
"ethereum-types>=0.2.1,<0.3",
@@ -79,6 +79,7 @@ docs = [
7979
"mkdocstrings-python>=1.0.0,<2",
8080
"pillow>=10.0.1,<11",
8181
"pyspelling>=2.8.2,<3",
82+
"lxml>=6.0.0,<7", # needs to be >= 6.0 for pypy
8283
"setuptools==78.0.2",
8384
]
8485

src/ethereum_clis/transition_tool.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from requests import Response
1717
from requests.exceptions import ConnectionError as RequestsConnectionError
18+
from requests.exceptions import ReadTimeout
1819
from requests_unixsocket import Session # type: ignore
1920

2021
from ethereum_test_base_types import BlobSchedule
@@ -297,6 +298,12 @@ def _evaluate_filesystem(
297298

298299
return output
299300

301+
def _restart_server(self):
302+
"""Check if the server is still responsive and restart if needed."""
303+
self.shutdown()
304+
time.sleep(0.1)
305+
self.start_server()
306+
300307
def _server_post(
301308
self,
302309
data: Dict[str, Any],
@@ -308,6 +315,7 @@ def _server_post(
308315
if url_args is None:
309316
url_args = {}
310317
post_delay = 0.1
318+
311319
while True:
312320
try:
313321
response = Session().post(
@@ -316,7 +324,8 @@ def _server_post(
316324
timeout=timeout,
317325
)
318326
break
319-
except RequestsConnectionError as e:
327+
except (RequestsConnectionError, ReadTimeout) as e:
328+
self._restart_server()
320329
retries -= 1
321330
if retries == 0:
322331
raise e

src/ethereum_test_fixtures/blockchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def model_post_init(self, __context):
181181
# if so, check if the field is required for the given fork.
182182
annotated_hints = get_type_hints(self, include_extras=True)
183183

184-
for field in self.model_fields:
184+
for field in self.__class__.model_fields:
185185
if field == "fork":
186186
continue
187187

@@ -199,7 +199,7 @@ def model_post_init(self, __context):
199199
def rlp_encode_list(self) -> List:
200200
"""Compute the RLP of the header."""
201201
header_list = []
202-
for field in self.model_fields:
202+
for field in self.__class__.model_fields:
203203
if field == "fork":
204204
continue
205205
value = getattr(self, field)

tox.ini

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ setenv =
5656
# Required for `cairosvg` so tox can find `libcairo-2`.
5757
# https://squidfunk.github.io/mkdocs-material/plugins/requirements/image-processing/?h=cairo#cairo-library-was-not-found
5858
DYLD_FALLBACK_LIBRARY_PATH = /opt/homebrew/lib
59-
commands =
59+
commands =
6060
ruff check --no-fix --show-fixes docs/scripts
6161
ruff format --check docs/scripts
6262
mkdocs build --strict
@@ -67,7 +67,7 @@ setenv =
6767
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
6868
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
6969
CI = {env:CI:}
70-
extras =
70+
extras =
7171
test
7272
lint # Required `gentest` for formatting tests
7373
commands =
@@ -113,9 +113,9 @@ extras =
113113
{[testenv:typecheck]extras}
114114
{[testenv:spellcheck]extras}
115115
{[testenv:pytest]extras}
116-
setenv =
116+
setenv =
117117
{[testenv:pytest]setenv}
118-
commands_pre =
118+
commands_pre =
119119
{[testenv:pytest]:commands_pre}
120120
commands =
121121
{[testenv:lint]commands}
@@ -133,10 +133,10 @@ extras =
133133
{[testenv:spellcheck]extras}
134134
{[testenv:tests-deployed]extras}
135135
{[testenv:tests-deployed-benchmark]extras}
136-
setenv =
136+
setenv =
137137
{[testenv:pytest]setenv}
138-
commands_pre =
139-
{[testenv:tests-deployed]:commands_pre}
138+
commands_pre =
139+
{[testenv:tests-deployed]:commands_pre}
140140
{[testenv:tests-deployed-benchmark]:commands_pre}
141141
commands =
142142
{[testenv:lint]commands}

uv.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)