Skip to content

NOT FOR MERGING: combined CI for #6193 and #6197 - #6206

Closed
rwgk wants to merge 15 commits into
pybind:masterfrom
rwgk:pr6193-with-pr6197-ci
Closed

rwgk wants to merge 15 commits into
pybind:masterfrom
rwgk:pr6193-with-pr6197-ci

Conversation

@rwgk

@rwgk rwgk commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

NOT FOR MERGING. This PR exists only to run CI on the combined changes from #6193 and #6197.

The integration branch starts at #6193 and merges #6197 into it:

This includes the restored Linux PyPy 7.3.23 / Python 3.11 job alongside the PyPy 8 jobs. Neither original PR branch is changed by this integration merge.

The PR is intentionally not a draft because this repository skips much of its CI matrix for draft PRs. Do not merge this PR.

Local validation: the branches merged without conflicts, git diff --check passed, and prek -a --quiet passed. CI results are left for manual review.

No changelog entry is needed for this temporary CI-only PR.

quinncheong and others added 15 commits October 5, 2026 19:14
Since pybind#5887 an enum with an unsigned underlying type compares unequal to
numpy integers, because the no-convert pass rejects __index__ objects for
unsigned targets and the catch-all overload returns false. Closes pybind#6192.
The no-convert early return was previously PyPy-only, so clang-tidy never
saw it; readability-braces-around-statements now flags it.
Fix two problems found with PyPy 3.12:

- Deallocating a py::dynamic_attr() instance aborted, because PyPy 3.12's
  _PyObject_GetDictPtr() cannot be called from tp_dealloc. Read the dict
  slot from tp_dictoffset on PyPy instead.
- memoryview::from_buffer() passed temporary shape/strides arrays, which
  PyPy keeps without copying. Use PyPy's inline _shape/_strides arrays.

Assisted-by: ClaudeCode:claude-opus-5-5
A later PyPy GC at an arbitrary point can run the Python-calling destructor
and abort.

Assisted-by: ClaudeCode:claude-opus-5-5
Add uint_passthrough(_noconvert) and run the existing int conversion
matrix against it, which also pins __index__ taking precedence over
__int__ for unsigned targets. Gate the explicit PyNumber_Index call on
PYBIND11_INDEX_CHECK so objects without __index__ no longer raise and
clear an extra TypeError in convert mode, and select the PyPy/unsigned
condition with a constexpr bool instead of two #if'd if-heads.

Assisted-by: ClaudeCode:claude-fable-5-1
PyLong_AsUnsignedLong does not call __int__, so the unsigned caster
falls back to PyNumber_Long and does not warn.

Assisted-by: ClaudeCode:claude-opus-5-5
PyPy below the supported 7.3.17 is not a target, and supported PyPy calls __index__ in PyLong_AsLong[Long] like CPython, so only unsigned targets need the explicit PyNumber_Index call. Also drops the complex.h comment that pointed at the removed branch.

Assisted-by: ClaudeCode:claude-opus-5-5
PyPy 8.0.1 fixes the deallocation bug, but 8.0.x releases share an
extension ABI. Retain the workaround throughout that minor series so
extensions built with newer headers can still run on 8.0.0.

Register PYPY_VERSION_NUM with the inline-header configuration checker.
Update the Linux Python 3.11 and macOS Python 3.12 jobs to PyPy 8.0.1.
Keep Linux Python 3.12 on 8.0.0 to exercise the deallocation and memoryview
workarounds without adding jobs.
Keep complex instances and __complex__ methods ahead of the legacy __index__ fallback. Retain support for older PyPy versions and update the workaround comment.

Add regression coverage for mixed protocols, complex subclasses, and failing __complex__ methods.

Assisted-by: Codex
Keep a pinned PyPy 7.3.23 / Python 3.11 job alongside the PyPy 8 matrix while PyPy 7 remains supported.

Assisted-by: Codex
NOT FOR MERGING. Temporary integration branch to run CI on the combined changes from PR pybind#6193 and PR pybind#6197.

Assisted-by: Codex
@rwgk

rwgk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

Closing after both #6197 and #6193 were merged.

@rwgk rwgk closed this Oct 19, 2026
@rwgk
rwgk deleted the pr6193-with-pr6197-ci branch October 19, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants