Compare commits

..

4 Commits

Author SHA1 Message Date
Michael Simacek
da4ecd82ab Limit test deps on graalpy to available binary wheels 2024-09-20 14:50:09 +02:00
Michael Simacek
8d4cc5c513 Add graalpy to CI 2024-09-20 14:50:09 +02:00
Michael Simacek
61a0f8ed86 Mark tests that currently fail on GraalPy with xfail 2024-09-20 14:50:09 +02:00
Michael Simacek
a00b51e250 Initial support for GraalPy 2024-09-20 14:50:09 +02:00
5 changed files with 40 additions and 6 deletions

View File

@ -39,6 +39,7 @@ jobs:
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
- 'graalpy-24.1'
# Items in here will either be added to the build matrix (if not
# present), or add new keys to an existing matrix element if all the
@ -67,6 +68,10 @@ jobs:
# Extra ubuntu latest job
- runs-on: ubuntu-latest
python: '3.11'
exclude:
# The setup-python action currently doesn't have graalpy for windows
- python: 'graalpy-24.1'
runs-on: 'windows-2022'
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"

View File

@ -2,11 +2,12 @@
build~=1.0; python_version>="3.8"
numpy~=1.23.0; python_version=="3.8" and platform_python_implementation=="PyPy"
numpy~=1.25.0; python_version=="3.9" and platform_python_implementation=='PyPy'
numpy~=1.21.5; platform_python_implementation!="PyPy" and python_version>="3.8" and python_version<"3.10"
numpy~=1.22.2; platform_python_implementation!="PyPy" and python_version=="3.10"
numpy~=1.26.0; platform_python_implementation!="PyPy" and python_version>="3.11" and python_version<"3.13"
numpy~=1.26.0; platform_python_implementation=="GraalVM" and sys_platform=="linux"
numpy~=1.21.5; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version>="3.8" and python_version<"3.10"
numpy~=1.22.2; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version=="3.10"
numpy~=1.26.0; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version>="3.11" and python_version<"3.13"
pytest~=7.0
pytest-timeout
scipy~=1.5.4; platform_python_implementation!="PyPy" and python_version<"3.10"
scipy~=1.8.0; platform_python_implementation!="PyPy" and python_version=="3.10" and sys_platform!='win32'
scipy~=1.11.1; platform_python_implementation!="PyPy" and python_version>="3.11" and python_version<"3.13" and sys_platform!='win32'
scipy~=1.5.4; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version<"3.10"
scipy~=1.8.0; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version=="3.10" and sys_platform!='win32'
scipy~=1.11.1; platform_python_implementation!="PyPy" and platform_python_implementation!="GraalVM" and python_version>="3.11" and python_version<"3.13" and sys_platform!='win32'

View File

@ -211,6 +211,11 @@ def _run_in_threads(test_fn, num_threads, parallel):
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_one_thread(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread.
@ -221,6 +226,11 @@ def test_run_in_process_one_thread(test_fn):
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_multiple_threads_parallel(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.
@ -231,6 +241,11 @@ def test_run_in_process_multiple_threads_parallel(test_fn):
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_multiple_threads_sequential(test_fn):
"""Makes sure there is no GIL deadlock when running in a thread multiple times sequentially.
@ -241,6 +256,11 @@ def test_run_in_process_multiple_threads_sequential(test_fn):
@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")
@pytest.mark.parametrize("test_fn", ALL_BASIC_TESTS_PLUS_INTENTIONAL_DEADLOCK)
@pytest.mark.xfail(
"env.GRAALPY",
reason="GraalPy transiently complains about unfinished threads at process exit",
strict=False,
)
def test_run_in_process_direct(test_fn):
"""Makes sure there is no GIL deadlock when using processes.

View File

@ -6,8 +6,14 @@ from io import StringIO
import pytest
import env # noqa: F401
from pybind11_tests import iostream as m
pytestmark = pytest.mark.skipif(
"env.GRAALPY",
reason="Delayed prints from finalizers from other tests can end up in the output",
)
def test_captured(capsys):
msg = "I've been redirected to Python, I hope!"

View File

@ -92,6 +92,7 @@ def test_override(capture, msg):
assert cstats.move_constructions >= 0
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
def test_alias_delay_initialization1(capture):
"""`A` only initializes its trampoline class when we inherit from it
@ -131,6 +132,7 @@ def test_alias_delay_initialization1(capture):
)
@pytest.mark.skipif("env.GRAALPY", reason="Cannot reliably trigger GC")
def test_alias_delay_initialization2(capture):
"""`A2`, unlike the above, is configured to always initialize the alias