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:
Michael Šimáček
2024-10-07 23:12:04 +02:00
committed by GitHub
parent 7e418f4924
commit c4a05f9344
42 changed files with 211 additions and 66 deletions

View File

@@ -39,6 +39,9 @@ def test_reference_internal():
assert str(b.get_a2()) == "A[43]"
assert str(b.a2) == "A[43]"
if env.GRAALPY:
pytest.skip("ConstructorStats is incompatible with GraalPy.")
astats, bstats = ConstructorStats.get(ms.A), ConstructorStats.get(ms.B)
assert astats.alive() == 2
assert bstats.alive() == 1
@@ -97,9 +100,9 @@ def test_def_submodule_failures():
sm = m.def_submodule(m, b"ScratchSubModuleName") # Using bytes to show it works.
assert sm.__name__ == m.__name__ + "." + "ScratchSubModuleName"
malformed_utf8 = b"\x80"
if env.PYPY:
if env.PYPY or env.GRAALPY:
# It is not worth the effort finding a trigger for a failure when running with PyPy.
pytest.skip("Sufficiently exercised on platforms other than PyPy.")
pytest.skip("Sufficiently exercised on platforms other than PyPy/GraalPy.")
else:
# Meant to trigger PyModule_GetName() failure:
sm_name_orig = sm.__name__