Skip to content

pybind11 3.1.0 - #297539

Merged
BrewTestBot merged 2 commits into
mainfrom
bump-pybind11-3.1.0
Aug 7, 2026
Merged

pybind11 3.1.0#297539
BrewTestBot merged 2 commits into
mainfrom
bump-pybind11-3.1.0

Conversation

@BrewTestBot

Copy link
Copy Markdown
Contributor

Created by brew bump


Created with brew bump-formula-pr.

Details

release notes
New Features:
  • Support for Python 3.8 was removed. The minimum supported version is now Python 3.9. #6110

  • Support for MSVC 2017 has been dropped. #6110

  • Changed strict-mode numeric conversions for PEP 484 compatibility: float now accepts int, and complex now accepts int and float. #5879

  • Small extra features added to the pybind11 command line tool based on python-config. #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

  • Add py::mod_gil_used() as replacement spelling to py::mod_gil_not_used(false). #5797

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

  • 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

  • Include the builtin complex type in the input annotation of the std::complex<T> type caster. #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

  • Drop Python 2 prepend to evaluated source, causing errors to be off by one. #6089

  • Fix data race on last_storage_ptr_ cache in gil_safe_call_once_and_store. #6087

  • Allow user defined __str__ on enum_. #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

  • Correct __delitem__ for negative-step slices and re-enable contiguous erase fast path. #6088

  • Do not pass -fno-fat-lto-objects to GCC on macOS, which made all LTO probes fail and silently disabled LTO. #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

  • Unset stale PYTHON_MODULE_DEBUG_POSTFIX and correct USE_PYTHON_INCLUDE_DIR variable. #6086

  • Apply -undefined dynamic_lookup to all Apple platforms. #6075

Internal:

  • Improved py::enum_ operator performance by restoring type-specific implementations. #5887

  • Optimized internal std::unordered_map/std::unordered_set hashing paths with noexcept. #5960

CI:

  • Test Python 3.15 in CI. #6107

  • Updated the CIBW test workflow to cibuildwheel v4.1 and bumped the Pyodide build to 314. #6095

View the full release notes at https://github.com/pybind/pybind11/releases/tag/v3.1.0.


@github-actions github-actions Bot added the bump-formula-pr PR was created using `brew bump-formula-pr` label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🤖 An automated task has requested bottles to be published to this PR.

Caution

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions Bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Aug 7, 2026
@BrewTestBot
BrewTestBot enabled auto-merge August 7, 2026 03:06
@BrewTestBot
BrewTestBot added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 406fc49 Aug 7, 2026
22 checks passed
@BrewTestBot
BrewTestBot deleted the bump-pybind11-3.1.0 branch August 7, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants