Skip to content
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

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Feb 2, 2025

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:

Support PyPy3.11

Copy link
Collaborator

@rwgk rwgk left a 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.)

@@ -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)
Copy link
Collaborator

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

@rwgk
Copy link
Collaborator

rwgk commented Feb 2, 2025

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?

@rwgk
Copy link
Collaborator

rwgk commented Feb 3, 2025

@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.

@rwgk rwgk merged commit fe87568 into pybind:master Feb 3, 2025
75 of 76 checks passed
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Feb 3, 2025
@mattip
Copy link
Contributor Author

mattip commented Feb 3, 2025

Thanks!

mgorny added a commit to mgorny/pybind11 that referenced this pull request Feb 20, 2025
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.
henryiii pushed a commit that referenced this pull request Feb 20, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changelog Possibly needs a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants