From bef14b9ab033b5154ff85392982eddf15e82114b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 3 Aug 2026 16:25:23 -0400 Subject: [PATCH 1/4] docs: add 3.1 entries to the changelog Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Henry Schreiner --- docs/changelog.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 9c624ef563..c342ab49fb 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,9 +17,70 @@ entry" block in pull request descriptions. New Features: +- Support for Python 3.8 was removed. The minimum supported version is now Python 3.9. + [#6110](https://github.com/pybind/pybind11/pull/6110) + +- Support for MSVC 2017 has been dropped. + [#6110](https://github.com/pybind/pybind11/pull/6110) + - Changed strict-mode numeric conversions for PEP 484 compatibility: `float` now accepts `int`, and `complex` now accepts `int` and `float`. [#5879](https://github.com/pybind/pybind11/pull/5879) +- Small extra features added to the pybind11 command line tool based on python-config. + [#4272](https://github.com/pybind/pybind11/pull/4272) + +- Added `subinterpreter_thread_state`, an RAII wrapper that owns a reusable `PyThreadState` for a sub-interpreter, together with a + `subinterpreter_scoped_activate` overload that activates it. This lets an OS thread re-enter one or more sub-interpreters without creating and destroying a + `PyThreadState` on every activation. + [#6073](https://github.com/pybind/pybind11/pull/6073) + +- Add `py::mod_gil_used()` as replacement spelling to `py::mod_gil_not_used(false)`. + [#5797](https://github.com/pybind/pybind11/pull/5797) + +Bug fixes: + +- Make `py::print` delegate to the current frame/interpreter built-ins `print` entry, + fixing handling of `sys.stdout = None`, following the active runtime's stream, keyword, + and error semantics, and remaining a no-op if the entry is unavailable during teardown. + [#6121](https://github.com/pybind/pybind11/pull/6121) + +- Include the builtin `complex` type in the input annotation of the + `std::complex` type caster. + [#6113](https://github.com/pybind/pybind11/pull/6113) + +- String views (e.g. `std::string_view`) are now kept alive only when loaded from a transient source (such as a generator), fixing both a use-after-free and a + regression where casting a view from a durable object outside a bound function would throw. + [#6096](https://github.com/pybind/pybind11/pull/6096) + +- Drop Python 2 prepend to evaluated source, causing errors to be off by one. + [#6089](https://github.com/pybind/pybind11/pull/6089) + +- Fix data race on `last_storage_ptr_` cache in `gil_safe_call_once_and_store`. + [#6087](https://github.com/pybind/pybind11/pull/6087) + +- Allow user defined `__str__` on `enum_`. + [#6078](https://github.com/pybind/pybind11/pull/6078) + +- Fix generated `Callable` type annotations for Python callbacks passed into C++ by inverting the callback's argument/return I/O context relative to the enclosing + function signature. + [#6055](https://github.com/pybind/pybind11/pull/6055) + +- Correct `__delitem__` for negative-step slices and re-enable contiguous erase fast path. + [#6088](https://github.com/pybind/pybind11/pull/6088) + +- Do not pass `-fno-fat-lto-objects` to GCC on macOS, which made all LTO probes fail and silently disabled LTO. + [#6114](https://github.com/pybind/pybind11/pull/6114) + +- Fixed cross-compilation to Emscripten/Pyodide with CMake ≥ 4.1 by no longer overriding an explicitly set `PYBIND11_USE_CROSSCOMPILING` when + `CMAKE_CROSSCOMPILING_EMULATOR` is defined. + [#6094](https://github.com/pybind/pybind11/pull/6094) + +- Unset stale `PYTHON_MODULE_DEBUG_POSTFIX` and correct `USE_PYTHON_INCLUDE_DIR` variable. + [#6086](https://github.com/pybind/pybind11/pull/6086) + +- Apply `-undefined dynamic_lookup` to all Apple platforms. + [#6075](https://github.com/pybind/pybind11/pull/6075) + Internal: - Improved `py::enum_` operator performance by restoring type-specific implementations. @@ -28,6 +89,14 @@ Internal: - Optimized internal `std::unordered_map`/`std::unordered_set` hashing paths with `noexcept`. [#5960](https://github.com/pybind/pybind11/pull/5960) +CI: + +- Test Python 3.15 in CI. + [#6107](https://github.com/pybind/pybind11/pull/6107) + +- Updated the CIBW test workflow to cibuildwheel v4.1 and bumped the Pyodide build to 314. + [#6095](https://github.com/pybind/pybind11/pull/6095) + ## Version 3.0.4 (April 18, 2026) From 0a2f96116b3c27f015fff502a03ab28e7f6b69e2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 3 Aug 2026 16:27:38 -0400 Subject: [PATCH 2/4] chore: prepare 3.1.0 release Assisted-by: ClaudeCode:claude-opus-5 --- docs/changelog.md | 2 +- include/pybind11/detail/common.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index c342ab49fb..bfa3add63b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,7 +13,7 @@ Changes will be added here periodically from the "Suggested changelog entry" block in pull request descriptions. -## Version 3.1.0 (this is still a work in progress) +## Version 3.1.0 (August 3, 2026) New Features: diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 7f182afb2c..740001db78 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -24,10 +24,10 @@ // - The release level is set to "alpha" for development versions. // Use 0xA0 (LEVEL=0xA, SERIAL=0) for development versions. // - For stable releases, set the serial to 0. -#define PYBIND11_VERSION_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA +#define PYBIND11_VERSION_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PYBIND11_VERSION_RELEASE_SERIAL 0 // String version of (micro, release level, release serial), e.g.: 0a0, 0b1, 0rc1, 0 -#define PYBIND11_VERSION_PATCH 0a0 +#define PYBIND11_VERSION_PATCH 0 /* -- end version constants -- */ #if !defined(Py_PACK_FULL_VERSION) From 8f017b6018c185e1b6f33877bf0709978324f3ac Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 3 Aug 2026 21:37:06 -0700 Subject: [PATCH 3/4] [skip ci] Change release date to August 4, 2026 --- docs/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index bfa3add63b..9d122199ea 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,7 +13,7 @@ Changes will be added here periodically from the "Suggested changelog entry" block in pull request descriptions. -## Version 3.1.0 (August 3, 2026) +## Version 3.1.0 (August 4, 2026) New Features: From a2da89392226790b46473307225cc99c7f1026a0 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 6 Aug 2026 09:23:56 -0400 Subject: [PATCH 4/4] docs: add #6127 entry and set release date to August 6, 2026 Assisted-by: ClaudeCode:claude-opus-5 --- docs/changelog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 9d122199ea..e0100ec0c7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -13,7 +13,7 @@ Changes will be added here periodically from the "Suggested changelog entry" block in pull request descriptions. -## Version 3.1.0 (August 4, 2026) +## Version 3.1.0 (August 6, 2026) New Features: @@ -39,6 +39,11 @@ New Features: Bug fixes: +- Fixed a crash in `py::subinterpreter::create()` when called without a current `PyThreadState`, which its documentation explicitly allows — for example from an + embedder that ended initialization with `PyEval_SaveThread()`, or from a worker thread that has never touched Python. `error_scope` is now constructed after a + thread state has been attached instead of before. + [#6127](https://github.com/pybind/pybind11/pull/6127) + - Make `py::print` delegate to the current frame/interpreter built-ins `print` entry, fixing handling of `sys.stdout = None`, following the active runtime's stream, keyword, and error semantics, and remaining a no-op if the entry is unavailable during teardown.