Skip to content

Commit 32aa982

Browse files
committed
feat(ci): pypy3.11 support
1 parent 9b30723 commit 32aa982

File tree

7 files changed

+45
-13
lines changed

7 files changed

+45
-13
lines changed

.github/workflows/tox_verify.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ jobs:
113113
include:
114114
- os: macos-latest
115115
python: "3.11"
116+
- os: macos-latest
117+
python: "pypy3.11"
116118
- os: ubuntu-latest
117119
python: "3.12"
118120
steps:
@@ -155,6 +157,9 @@ jobs:
155157
- os: [self-hosted-ghr, size-xl-x64]
156158
name: self-hosted-ghr-xl-x64
157159
python: "3.11"
160+
- os: [self-hosted-ghr, size-xl-x64]
161+
name: self-hosted-ghr-xl-x64-pypy
162+
python: "pypy3.11"
158163
- os: macos-latest
159164
name: macos-latest
160165
python: "3.12"
@@ -175,6 +180,9 @@ jobs:
175180
cache-dependency-glob: "uv.lock"
176181
version: ${{ vars.UV_VERSION }}
177182
python-version: ${{ matrix.python }}
183+
- name: Install linux dependencies
184+
if: matrix.python == 'pypy3.11' && contains(matrix.os, 'self-hosted-ghr')
185+
run: sudo apt-get install -y pkg-config libsecp256k1-dev
178186
- name: Update eels_resolutions.json
179187
run: |
180188
sed -i -e "s|\$GITHUB_WORKSPACE|${GITHUB_WORKSPACE}|g" .github/configs/eels_resolutions.json
@@ -190,6 +198,8 @@ jobs:
190198
include:
191199
- os: ubuntu-latest
192200
python: "3.11"
201+
- os: ubuntu-latest
202+
python: "pypy3.11"
193203
- os: macos-latest
194204
python: "3.12"
195205
steps:

docs/CHANGELOG.md

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

8989
### 📋 Misc
9090

91+
- ✨ Add pypy3.11 support ([#1854](https://github.com/ethereum/execution-spec-tests/pull/1854)).
9192
- 🔀 Use only relative imports in `tests/` directory ([#1848](https://github.com/ethereum/execution-spec-tests/pull/1848)).
9293
- 🔀 Misc. doc updates, including a navigation footer ([#1846](https://github.com/ethereum/execution-spec-tests/pull/1846)).
9394
- 🔀 Remove Python 3.10 support ([#1808](https://github.com/ethereum/execution-spec-tests/pull/1808)).

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: 20 additions & 2 deletions
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,18 @@ def _evaluate_filesystem(
297298

298299
return output
299300

301+
def _check_server_health(self, session: Session):
302+
"""Check if the server is still responsive and restart if needed."""
303+
try:
304+
session.post(self.server_url, json={}, timeout=2)
305+
return True
306+
except Exception:
307+
self.shutdown()
308+
time.sleep(0.1)
309+
self.start_server()
310+
time.sleep(0.5)
311+
return False
312+
300313
def _server_post(
301314
self,
302315
data: Dict[str, Any],
@@ -308,15 +321,20 @@ def _server_post(
308321
if url_args is None:
309322
url_args = {}
310323
post_delay = 0.1
324+
311325
while True:
312326
try:
313-
response = Session().post(
327+
session = Session()
328+
response = session.post(
314329
f"{self.server_url}?{urlencode(url_args, doseq=True)}",
315330
json=data,
316331
timeout=timeout,
317332
)
318333
break
319-
except RequestsConnectionError as e:
334+
except (RequestsConnectionError, ReadTimeout) as e:
335+
if not self._check_server_health(session):
336+
# Server was restarted, try again
337+
continue
320338
retries -= 1
321339
if retries == 0:
322340
raise e

src/ethereum_test_fixtures/blockchain.py

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

182-
for field in self.model_fields:
182+
for field in self.__class__.model_fields:
183183
if field == "fork":
184184
continue
185185

@@ -197,7 +197,7 @@ def model_post_init(self, __context):
197197
def rlp_encode_list(self) -> List:
198198
"""Compute the RLP of the header."""
199199
header_list = []
200-
for field in self.model_fields:
200+
for field in self.__class__.model_fields:
201201
if field == "fork":
202202
continue
203203
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)