Skip to content

Commit cf28f6e

Browse files
authored
Update supported Pyodide versions (#186)
1 parent 54307c0 commit cf28f6e

6 files changed

Lines changed: 62 additions & 22 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
build-artifact-name: none
1717
build-artifact-path: none
18-
pyodide-versions: "0.27.2,0.26.4"
18+
pyodide-versions: "0.29.3,0.28.3,0.27.2,0.26.4"
1919

2020
deploy:
2121
runs-on: ubuntu-24.04

.github/workflows/main.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ on:
1212
pyodide-version:
1313
required: false
1414
type: string
15-
default: "0.27.2"
15+
default: "0.29.3"
16+
python-version:
17+
required: false
18+
type: string
19+
default: "3.13"
1620
os:
1721
required: false
1822
type: string
@@ -102,7 +106,7 @@ jobs:
102106

103107
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
104108
with:
105-
python-version: 3.12
109+
python-version: ${{ inputs.python-version }}
106110

107111
- name: install pyodide-py
108112
run: |

.github/workflows/testall.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
build-artifact-name: ${{ inputs.build-artifact-name }}
8181
build-artifact-path: ${{ inputs.build-artifact-path }}
8282
pyodide-version: ${{ matrix.pyodide_version }}
83+
python-version: ${{ matrix.python_version }}
8384
os: ${{ matrix.os }}
8485
runner: ${{ matrix.runner }}
8586
browser: ${{ matrix.browser }}

COMPATIBILITY.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Following versions of pytest-pyodide and Pyodide are tested in CI.
44
Other versions may work, however with no guarantee.
55

6-
| pytest-pyodide | Tested Pyodide versions |
7-
| -------------- | ----------------------- |
8-
| main branch | 0.26.4, 0.27.2 |
9-
| 0.58.* | 0.24.1, 0.25.1, 0.26.1 |
10-
| 0.57.* | 0.23.4, 0.24.1, 0.25.1 |
11-
| 0.56.* | 0.23.4, 0.24.1 |
12-
| 0.55.* | 0.23.4, 0.24.1 |
13-
| 0.54.* | 0.23.4, 0.24.1 |
14-
| 0.53.* | 0.23.2, 0.22.0 |
15-
| 0.52.* | 0.23.2, 0.22.0 |
16-
| 0.51.* | 0.23.2, 0.22.0, 0.21.3 |
17-
| 0.50.* | 0.22.0, 0.21.3 |
18-
| 0.23.* | 0.21.0 |
6+
| pytest-pyodide | Tested Pyodide versions |
7+
| -------------- | ------------------------------ |
8+
| main branch | 0.26.4, 0.27.2, 0.28.3, 0.29.3 |
9+
| 0.58.* | 0.24.1, 0.25.1, 0.26.1 |
10+
| 0.57.* | 0.23.4, 0.24.1, 0.25.1 |
11+
| 0.56.* | 0.23.4, 0.24.1 |
12+
| 0.55.* | 0.23.4, 0.24.1 |
13+
| 0.54.* | 0.23.4, 0.24.1 |
14+
| 0.53.* | 0.23.2, 0.22.0 |
15+
| 0.52.* | 0.23.2, 0.22.0 |
16+
| 0.51.* | 0.23.2, 0.22.0, 0.21.3 |
17+
| 0.50.* | 0.22.0, 0.21.3 |
18+
| 0.23.* | 0.21.0 |

tests/test_doctest.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from pathlib import Path
23
from textwrap import dedent
34

@@ -83,19 +84,25 @@ def pytest_fixture_setup(self, fixturedef, request):
8384
result.assertoutcome(passed=2, failed=1)
8485
result.getfailures()[0]
8586
captured = capsys.readouterr()
86-
# The indentation is different here in Python 3.12 vs Python 3.13...
87+
# The indentation is different here in Python 3.12 vs Python 3.13 vs Python 3.14...
8788
expected = dedent(
8889
"""
89-
003 >>> from js import Object # doctest: +RUN_IN_PYODIDE
90-
004 >>> 1 == 2
90+
003 >>> from js import Object # doctest: +RUN_IN_PYODIDE
91+
004 >>> 1 == 2
9192
Expected:
9293
True
9394
Got:
9495
False
9596
"""
9697
).strip()
97-
print(captured.out)
98-
assert expected in captured.out
98+
99+
def normalize(s):
100+
return re.sub(r" +>", " >", s)
101+
102+
result = normalize(captured.out)
103+
print(result)
104+
105+
assert expected in result
99106

100107

101108
def test_doctest_collect(pytester):

utils/build_test_matrix.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@
1818
DEFAULT_PLAYWRIGHT_VERSION = "1.44.0"
1919

2020

21+
@dataclasses.dataclass
22+
class VersionPair:
23+
pyodide_version: tuple[int, int]
24+
python_version: str
25+
26+
27+
PYODIDE_TO_PYTHON_VERSION: list[VersionPair] = [
28+
VersionPair(pyodide_version=(0, 28), python_version="3.13"),
29+
VersionPair(pyodide_version=(0, 25), python_version="3.12"),
30+
VersionPair(pyodide_version=(0, 23), python_version="3.11"),
31+
]
32+
33+
34+
def python_version_for_pyodide(pyodide_version: str) -> str:
35+
pyodide_ver = tuple(int(x) for x in pyodide_version.split(".")[:2])
36+
for pair in PYODIDE_TO_PYTHON_VERSION:
37+
if pyodide_ver >= pair.pyodide_version:
38+
return pair.python_version
39+
return "3.10"
40+
41+
2142
@dataclasses.dataclass
2243
class TestConfig:
2344
pyodide_version: str
@@ -26,6 +47,7 @@ class TestConfig:
2647
browser: str
2748
browser_version: str = ""
2849
playwright_version: str = ""
50+
python_version: str = ""
2951

3052
@property
3153
def runtime(self) -> str:
@@ -130,7 +152,13 @@ def build_configs(args: dict[str, list[str]]) -> list[TestConfig]:
130152
for _os, _pyodide_version, _runner, _browser in itertools.product(
131153
os, pyodide_version, runner, browser
132154
):
133-
config = TestConfig(_pyodide_version, _os, _runner, _browser)
155+
config = TestConfig(
156+
_pyodide_version,
157+
_os,
158+
_runner,
159+
_browser,
160+
python_version=python_version_for_pyodide(_pyodide_version),
161+
)
134162

135163
if not is_valid_config(config):
136164
continue

0 commit comments

Comments
 (0)