If possible, attach Python exception with py::raise_from to TypeError when casting from C++ to Python. This will give additional info if Python exceptions occur in the caster. Adds a test case of trying to convert a set from C++ to Python when the hash function is not defined in Python. #3605
Add a mapping of C++11 nested exceptions to their Python exception equivalent using py::raise_from. This attaches the nested exceptions in Python using the __cause__ field. #3608
Propagate Python exception traceback using raise_from if a pybind11 function runs out of overloads. #3671
py::multiple_inheritance is now only needed when C++ bases are hidden from pybind11. #3650 and #3659
Bug fixes:
Remove a boolean cast in numpy.h that causes MSVC C4800 warnings when compiling against Python 3.10 or newer. #3669
Render py::bool_ and py::float_ as bool and float respectively. #3622
Build system improvements:
Fix CMake extension suffix computation on Python 3.10+. #3663
Allow CMAKE_ARGS to override CMake args in pybind11's own setup.py. #3577
Add clang-tidy readability check to catch potentially swapped function args. #3611
Version 2.9.0
This is the last version to support Python 2.7 and 3.5.
New Features:
Allow py::args to be followed by other arguments; the remaining arguments are implicitly keyword-only, as if a py::kw_only{} annotation had been used. #3402
Changes:
Make str/bytes/memoryview more interoperable with std::string_view. #3521
Replace _ with const_name in internals, avoid defining pybind::_ if _ defined as macro (common gettext usage) #3423
Bug fixes:
Fix a rare warning about extra copy in an Eigen constructor. #3486
If possible, attach Python exception with py::raise_from to TypeError
when casting from C++ to Python. This will give additional info if Python
exceptions occur in the caster. Adds a test case of trying to convert a set
from C++ to Python when the hash function is not defined in Python.
[#3605](https://github.com/pybind/pybind11/issues/3605) <https://github.com/pybind/pybind11/pull/3605>_
Add a mapping of C++11 nested exceptions to their Python exception
equivalent using py::raise_from. This attaches the nested exceptions in
Python using the __cause__ field.
[#3608](https://github.com/pybind/pybind11/issues/3608) <https://github.com/pybind/pybind11/pull/3608>_
Propagate Python exception traceback using raise_from if a pybind11
function runs out of overloads.
[#3671](https://github.com/pybind/pybind11/issues/3671) <https://github.com/pybind/pybind11/pull/3671>_
py::multiple_inheritance is now only needed when C++ bases are hidden
from pybind11.
[#3650](https://github.com/pybind/pybind11/issues/3650) <https://github.com/pybind/pybind11/pull/3650>_ and
[#3659](https://github.com/pybind/pybind11/issues/3659) <https://github.com/pybind/pybind11/pull/3659>_
Bug fixes:
Remove a boolean cast in numpy.h that causes MSVC C4800 warnings when
compiling against Python 3.10 or newer.
[#3669](https://github.com/pybind/pybind11/issues/3669) <https://github.com/pybind/pybind11/pull/3669>_
Render py::bool_ and py::float_ as bool and float
respectively.
[#3622](https://github.com/pybind/pybind11/issues/3622) <https://github.com/pybind/pybind11/pull/3622>_
Build system improvements:
Fix CMake extension suffix computation on Python 3.10+.
[#3663](https://github.com/pybind/pybind11/issues/3663) <https://github.com/pybind/pybind11/pull/3663>_
Allow CMAKE_ARGS to override CMake args in pybind11's own setup.py.
[#3577](https://github.com/pybind/pybind11/issues/3577) <https://github.com/pybind/pybind11/pull/3577>_
Remove a few deprecated c-headers.
[#3610](https://github.com/pybind/pybind11/issues/3610) <https://github.com/pybind/pybind11/pull/3610>_
More uniform handling of test targets.
[#3590](https://github.com/pybind/pybind11/issues/3590) <https://github.com/pybind/pybind11/pull/3590>_
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps pybind11 from 2.8.1 to 2.9.1.
Release notes
Sourced from pybind11's releases.
Changelog
Sourced from pybind11's changelog.
... (truncated)
Commits
ffa3468
chore: bump to 2.9.13899dc6
Documenting missing unit test coverage. (#3673)0f6ad91
docs: update changelog for 2.9.1 (#3670)21e1094
ci: move centos 8 to stream (#3675)ce18721
Ensure TypeError use raise_from for C++->Python overload res. (#3671)978617f
fix issue 3668 by removing bool casts in numpy.h (#3669)3a8d923
Fix caster optimization regression introduced in #3650 (#3659)bf7e5f9
fix(setup): support overriding CMake args (#3577)dc4717b
fix: module extension detection for python 3.10 (#3663)07103d6
Remove extra semicolon (#3666)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)