feat: PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT#5508
feat: PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT#5508rwgk merged 3 commits intopybind:masterfrom
Conversation
rwgk
left a comment
There was a problem hiding this comment.
I think it's fine to simply merge this PR for now and update .github/workflows/ci.yml after PyPy 3.11 is released. (I'm assuming it is more straightforward to do that after the release.)
include/pybind11/detail/class.h
Outdated
| auto *type = &heap_type->ht_type; | ||
| type->tp_flags |= Py_TPFLAGS_HAVE_GC; | ||
| #if PY_VERSION_HEX < 0x030B0000 | ||
| #if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION) |
There was a problem hiding this comment.
Could you please add a simple comment, e.g.
#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION) // For PyPy see PR #5508
|
The CI / 🐍 graalpy-24.1 • macos-13 • x64 failure is definitely unrelated. @msimacek FYI: I've seen that test flaking a few times in the past ~week. It made me wonder, has something changed recently? |
|
@msimacek CI / 🐍 graalpy-24.1 • macos-13 • x64 failed again. I'm still certain it's unrelated to this PR, but the likelihood of these failures is definitely up by a lot recently. I'll go ahead with merging this PR. |
|
Thanks! |
Adjust the `Py_TPFLAGS_MANAGED_DICT` logic in `include/pybind11/attr.h` to match the one used in `include/pybind11/detail/class.h`. This is a followup to pybind#5508.
* Sync `Py_TPFLAGS_MANAGED_DICT` for PyPy3.11 across the codebase Adjust the `Py_TPFLAGS_MANAGED_DICT` logic in `include/pybind11/attr.h` to match the one used in `include/pybind11/detail/class.h`. This is a followup to #5508. * Use a common `#define` for pre-`Py_TPFLAGS_MANAGED_DICT` Pythons * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
Would be nice to backports this to older, major version 2, including #5537 |
|
I don’t think PyPy2 should be used in anything except as the build platform for RPython at this point. I would prefer to deprecate use of the CPython CAPI with PyPy2. |
|
Do you mean pybind11 version two? I don’t think we have the resources to support that version. |
|
I meant pybind11 version 2 but I just saw that NixOS upgraded to the current pybind11 a few days ago, so that is no longer a concern. |
Description
PyPy support for Python 3.11 is almost ready for release. The new
Py_TPFLAGS_MANAGED_DICTis an implementation detail, and PyPy has not yet implemented support for it, see pypy/pypy#5125. I am testing pybind11 via a weekly cron job and noticed the failure there. Where would be a good place to add a CI run of PyPy 3.11, which has not been released yet, here?Suggested changelog entry: