-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT #5508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -574,7 +574,7 @@ extern "C" inline int pybind11_clear(PyObject *self) { | |||
inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
Description
PyPy support for Python 3.11 is almost ready for release. The new
Py_TPFLAGS_MANAGED_DICT
is 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: