pybind11
pybind11 copied to clipboard
Add support for GraalPy
Description
Hi, I'm a GraalPy developer and I'd like to add support for GraalPy to pybind11. We've been using pybind11 with GraalPy for quite a while, but we relied on a downstream patch. Most of the changes to non-test code just add another condition to existing ifdefs that were there for PyPy. In order to pass the tests on GraalPy, I had to skip several tests that rely on reference counting and finalizers, because unfortunately it's not really possible to always reliably trigger the GC-dependent finalizers at a specific point on GraalPy. I also marked a few failing tests with xfail for now if they seemed like bugs that should be fixed on GraalPy's side. I'll try to look into fixing those in the near future. If you're not opposed, I'd also like to try adding current version of GraalPy to the CI matrix.
CC @timfel @steve-s
Suggested changelog entry:
Added support for GraalPy Python implementation (https://github.com/oracle/graalpython)
CI addition sounds good, thanks!
Hi @rwgk, I finally got the CI working. The issue with the "unstable" (maximum internals version) tests was because in GraalPy PyCapsule_GetName currently returns a copy of the name and pybind11 does pointer comparison with the original string it passed in when creating the capsule. I'll fix that for the next release of GraalPy, but for now, I disabled using the capsule names on GraalPy (like this). Let me know if that's ok. I could also do a full string comparison, but that sounds like it could kill performance. Other than that, I tried to "localize" the skipping of GC/refcount-dependent test parts, as you requested.