Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
build-artifact-name: none
build-artifact-path: none
pyodide-versions: "0.27.2,0.26.4"
pyodide-versions: "0.29.3,0.28.3,0.27.2,0.26.4"

deploy:
runs-on: ubuntu-24.04
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ on:
pyodide-version:
required: false
type: string
default: "0.27.2"
default: "0.29.3"
python-version:
required: false
type: string
default: "3.13"
os:
required: false
type: string
Expand Down Expand Up @@ -102,7 +106,7 @@ jobs:

- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12
python-version: ${{ inputs.python-version }}

- name: install pyodide-py
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/testall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
build-artifact-name: ${{ inputs.build-artifact-name }}
build-artifact-path: ${{ inputs.build-artifact-path }}
pyodide-version: ${{ matrix.pyodide_version }}
python-version: ${{ matrix.python_version }}
os: ${{ matrix.os }}
runner: ${{ matrix.runner }}
browser: ${{ matrix.browser }}
Expand Down
26 changes: 13 additions & 13 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
Following versions of pytest-pyodide and Pyodide are tested in CI.
Other versions may work, however with no guarantee.

| pytest-pyodide | Tested Pyodide versions |
| -------------- | ----------------------- |
| main branch | 0.26.4, 0.27.2 |
| 0.58.* | 0.24.1, 0.25.1, 0.26.1 |
| 0.57.* | 0.23.4, 0.24.1, 0.25.1 |
| 0.56.* | 0.23.4, 0.24.1 |
| 0.55.* | 0.23.4, 0.24.1 |
| 0.54.* | 0.23.4, 0.24.1 |
| 0.53.* | 0.23.2, 0.22.0 |
| 0.52.* | 0.23.2, 0.22.0 |
| 0.51.* | 0.23.2, 0.22.0, 0.21.3 |
| 0.50.* | 0.22.0, 0.21.3 |
| 0.23.* | 0.21.0 |
| pytest-pyodide | Tested Pyodide versions |
| -------------- | ------------------------------ |
| main branch | 0.26.4, 0.27.2, 0.28.3, 0.29.3 |
| 0.58.* | 0.24.1, 0.25.1, 0.26.1 |
| 0.57.* | 0.23.4, 0.24.1, 0.25.1 |
| 0.56.* | 0.23.4, 0.24.1 |
| 0.55.* | 0.23.4, 0.24.1 |
| 0.54.* | 0.23.4, 0.24.1 |
| 0.53.* | 0.23.2, 0.22.0 |
| 0.52.* | 0.23.2, 0.22.0 |
| 0.51.* | 0.23.2, 0.22.0, 0.21.3 |
| 0.50.* | 0.22.0, 0.21.3 |
| 0.23.* | 0.21.0 |
17 changes: 12 additions & 5 deletions tests/test_doctest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from pathlib import Path
from textwrap import dedent

Expand Down Expand Up @@ -83,19 +84,25 @@ def pytest_fixture_setup(self, fixturedef, request):
result.assertoutcome(passed=2, failed=1)
result.getfailures()[0]
captured = capsys.readouterr()
# The indentation is different here in Python 3.12 vs Python 3.13...
# The indentation is different here in Python 3.12 vs Python 3.13 vs Python 3.14...
expected = dedent(
"""
003 >>> from js import Object # doctest: +RUN_IN_PYODIDE
004 >>> 1 == 2
003 >>> from js import Object # doctest: +RUN_IN_PYODIDE
004 >>> 1 == 2
Expected:
True
Got:
False
"""
).strip()
print(captured.out)
assert expected in captured.out

def normalize(s):
return re.sub(r" +>", " >", s)

result = normalize(captured.out)
print(result)

assert expected in result


def test_doctest_collect(pytester):
Expand Down
30 changes: 29 additions & 1 deletion utils/build_test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@
DEFAULT_PLAYWRIGHT_VERSION = "1.44.0"


@dataclasses.dataclass
class VersionPair:
pyodide_version: tuple[int, int]
python_version: str


PYODIDE_TO_PYTHON_VERSION: list[VersionPair] = [
VersionPair(pyodide_version=(0, 28), python_version="3.13"),
VersionPair(pyodide_version=(0, 25), python_version="3.12"),
VersionPair(pyodide_version=(0, 23), python_version="3.11"),
]


def python_version_for_pyodide(pyodide_version: str) -> str:
pyodide_ver = tuple(int(x) for x in pyodide_version.split(".")[:2])
for pair in PYODIDE_TO_PYTHON_VERSION:
if pyodide_ver >= pair.pyodide_version:
return pair.python_version
return "3.10"


@dataclasses.dataclass
class TestConfig:
pyodide_version: str
Expand All @@ -26,6 +47,7 @@ class TestConfig:
browser: str
browser_version: str = ""
playwright_version: str = ""
python_version: str = ""

@property
def runtime(self) -> str:
Expand Down Expand Up @@ -130,7 +152,13 @@ def build_configs(args: dict[str, list[str]]) -> list[TestConfig]:
for _os, _pyodide_version, _runner, _browser in itertools.product(
os, pyodide_version, runner, browser
):
config = TestConfig(_pyodide_version, _os, _runner, _browser)
config = TestConfig(
_pyodide_version,
_os,
_runner,
_browser,
python_version=python_version_for_pyodide(_pyodide_version),
)

if not is_valid_config(config):
continue
Expand Down
Loading