mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
Add support for GraalPy (#5380)
* Initial support for GraalPy * Mark tests that currently fail on GraalPy with xfail * Add graalpy to CI * Limit test deps on graalpy to available binary wheels * Skip cmake test installed_function on GraalPy CMake won't find libpython on GraalPy, it either fails or silently picks CPython's libpython. * Factor out setting function docstrings into a macro * Try to narrow down skipped tests
This commit is contained in:
@@ -4,7 +4,7 @@ import sys
|
||||
|
||||
import pytest
|
||||
|
||||
import env # noqa: F401
|
||||
import env
|
||||
|
||||
m = pytest.importorskip("pybind11_tests.virtual_functions")
|
||||
from pybind11_tests import ConstructorStats # noqa: E402
|
||||
@@ -82,6 +82,9 @@ def test_override(capture, msg):
|
||||
"""
|
||||
)
|
||||
|
||||
if env.GRAALPY:
|
||||
pytest.skip("ConstructorStats is incompatible with GraalPy.")
|
||||
|
||||
cstats = ConstructorStats.get(m.ExampleVirt)
|
||||
assert cstats.alive() == 3
|
||||
del ex12, ex12p, ex12p2
|
||||
@@ -91,6 +94,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
|
||||
|
||||
@@ -130,6 +134,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
|
||||
|
||||
@@ -188,7 +193,7 @@ def test_alias_delay_initialization2(capture):
|
||||
|
||||
# PyPy: Reference count > 1 causes call with noncopyable instance
|
||||
# to fail in ncv1.print_nc()
|
||||
@pytest.mark.xfail("env.PYPY")
|
||||
@pytest.mark.xfail("env.PYPY or env.GRAALPY")
|
||||
@pytest.mark.skipif(
|
||||
not hasattr(m, "NCVirt"), reason="NCVirt does not work on Intel/PGI/NVCC compilers"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user