chore(deps): update dependency pybind11 to >=2.11.1 #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=2.2
->>=2.11.1
Release Notes
pybind/pybind11 (pybind11)
v2.11.1
: Version 2.11.1Compare Source
Changes:
PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF
is now provided as an option for disabling the default-onPyGILState_Check()
's inpybind11::handle
'sinc_ref()
&dec_ref()
. #4753PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
was disabled for PyPy in general (not just PyPy Windows). #4751NOTE: There was a version number mishap in the first attempt making this release. It was fixed within minutes with #4756 and the stable branch was re-tagged. The upload to PyPI only succeeded for the corrected release.
v2.11.0
: Version 2.11.0Compare Source
New features:
pybind11::detail::is_move_constructible
trait can be specialized for cases in whichstd::is_move_constructible
does not work as needed. This is very similar to the long-establishedpybind11::detail::is_copy_constructible
. #4631recursive_container_traits
. #4623pybind11/type_caster_pyobject_ptr.h
was added to support automatic wrapping of APIs that make use ofPyObject *
. This header needs to included explicitly (i.e. it is not included implicitly withpybind/pybind11.h
). #4601format_descriptor<>
&npy_format_descriptor<>
PyObject *
specializations were added. The latter enablespy::array_t<PyObject *>
to/from-python conversions. #4674buffer_info
gained anitem_type_is_equivalent_to<T>()
member function. #4674capsule
API gained a user-friendly constructor (py::capsule(ptr, "name", dtor)
). #4720Changes:
PyGILState_Check()
's inpybind11::handle
'sinc_ref()
&dec_ref()
are now enabled by default again. #4246py::initialize_interpreter()
usingPyConfig_InitPythonConfig()
instead ofPyConfig_InitIsolatedConfig()
, to obtain completesys.path
. #4473PYBIND11_DETAILED_ERROR_MESSAGES
is not defined. This increases binary sizes slightly (~1.5%) but the error messages are much more informative. #4463std::array
-list caster was fixed. Previously, signatures included the size of the list in a non-standard, non-spec compliant way. The new format conforms to PEP 593. Tooling for processing the docstrings may need to be updated accordingly. #4679noexcept(true)
in C++17. #4593PYBIND11_INTERNALS_VERSION 5
(default for Python 3.12+), MSVC builds usestd::hash<std::type_index>
andstd::equal_to<std::type_index>
instead of string-based type comparisons. This resolves issues when binding types defined in the unnamed namespace. #4319__notes__
(introduced with Python 3.11) are now added to theerror_already_set::what()
output. #4678Build system improvements:
FindPythonInterp
is not present. #4719lto
checks and target generation whenCMAKE_INTERPROCEDURAL_OPTIMIZATION
is defined. #4643-stdlib=libc++
, not needed for modern Pythons (macOS 10.9+). #4639v2.10.4
: Version 2.10.4Compare Source
Changes:
python3 -m pybind11
gained a--version
option (prints the version and exits). #4526Bug Fixes:
gil_scoped_release
RAII is non-copyable. #4490v2.10.3
: Version 2.10.3Compare Source
Changes:
PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
, will be enabled in 2.11). #4432inc_ref
/dec_ref
are called with an invalid GIL state. #4427 #4436Bug Fixes:
v2.10.2
: Version 2.10.2Compare Source
Changes:
scoped_interpreter
constructor takingPyConfig
. #4372pybind11/eigen/tensor.h
adds converters to and fromEigen::Tensor
andEigen::TensorMap
#4201PyGILState_Check()
's were integrated topybind11::handle
inc_ref()
&dec_ref()
. The added GIL checks are guarded byPYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
, which is the default only ifNDEBUG
is not defined. #4246KeysView
,ValuesView
andItemsView
inbind_map
. #4353Bug fixes:
PyEval_InitThreads()
call to the correct location. #4350Build system improvements:
find_package(pybind11 CONFIG)
multiple times from separate directories in the same CMake project and properly link Python (new mode). #4401multiprocessing_set_spawn
in pytest fixture for added safety. #4377v2.10.1
: Version 2.10.1Compare Source
This is the first version to fully support embedding the newly released Python 3.11.
Changes:
pybind11::capsule
constructor to take null destructor pointers. #4221embed.h
was changed so thatPYTHONPATH
is used also with Python 3.11 (established behavior). #4119PYBIND11_SIMPLE_GIL_MANAGEMENT
option was added (cmake, C++ define), along with many additional tests intest_gil_scoped.py
. The option may be useful to try when debugging GIL-related issues, to determine if the more complex default implementation is or is not to blame. See #4216 for background. WARNING: Please be careful to not create ODR violations when using the option: everything that is linked together with mutual symbol visibility needs to be rebuilt. #4216PYBIND11_EXPORT_EXCEPTION
was made non-empty only under macOS. This makes Linux builds safer, and enables the removal of warning suppression pragmas for Windows. #4298Bug fixes:
UnicodeDecodeError
was not propagated from variouspy::str
ctors when decoding surrogate utf characters. #4294make_iterator
. This broke at least one valid use case. May revisit later. #4234void*
(regression in 2.10.0). #4275char8_t
support (regression in 2.9). #4278error_already_set::what()
. #4297overload_cast
. #4188py::error_already_set
implementation, related to PR #1895 released with v2.10.0. #4079std::forward_like
is available. #4136get_local_internals()
was made compatible withfinalize_interpreter()
, fixing potential freezes during interpreter finalization. #4192Performance and style:
PYBIND11_OBJECT
macros and enforce the clang-tidy checksmodernize-use-equals-default
in macros as well. #4017PyObject_GenericGetDict
andPyObject_GenericSetDict
for handling dynamic attribute dictionaries. #4106PYBIND11_NAMESPACE
instead of usingpybind11
when opening namespaces. Using namespace declarations and namespace qualification remain the same aspybind11
. This is done to ensure consistent symbol visibility. #4098detail::forward_like
as constexpr. #4147arg_v
arguments. #4219None
. #4269Build system improvements:
PYBIND11_PYTHONLIBS_OVERRWRITE OFF
. #4195CMAKE_BUILD_TYPE
is set toDEBUG
instead ofDebug
. #4078v2.10.0
: Version 2.10.0Compare Source
Removed support for Python 2.7, Python 3.5, and MSVC 2015. Support for MSVC 2017 is limited due to availability of CI runners; we highly recommend MSVC 2019 or 2022 be used. Initial support added for Python 3.11.
New features:
py::anyset
&py::frozenset
were added, with copying (cast) tostd::set
(similar toset
). #3901type_caster<std::monostate>
was added.std::monostate
is a tag type that allowsstd::variant
to act as an optional, or allows default construction of astd::variant
holding a non-default constructible type. #3818pybind11::capsule::set_name
added to mutate the name of the capsule instance. #3866dtype.num
,dtype.byteorder
,dtype.flags
anddtype.alignment
added. #3868Changes:
error_already_set
is now safer and more performant, especially for exceptions with long tracebacks, by delaying computation. #1895str
bindings. #3826PYBIND11_OBJECT_CVT
andPYBIND11_OBJECT_CVT_DEFAULT
macro can now be used to define classes in namespaces other than pybind11. #3797PYBIND11_DETAILED_ERROR_MESSAGES
instead of requiringNDEBUG
, allowing use with release builds if desired. #39130
topybind11::handle
is now disabled. #4008Bug fixes:
pybind11::weakref()
fails. #3739module_::def_submodule
was missing proper error handling. This is fixed now. #3973error_already_set
was made safer and the highly opaque "Unknown internal error occurred" message was replaced with a more helpful message. #3982error_already_set::what()
now handles non-normalized exceptions correctly. #3971std::experimental::filesystem
. #3840-Wfree-nonheap-object
warnings produced by GCC by avoiding returning pointers to static objects withreturn_value_policy::take_ownership
. #3946PYBIND11_NAMESPACE
__attribute__((visibility("hidden")))
inconsistencies are now fixed (affects only unusual environments). #4043pybind11::detail::get_internals()
is now resilient to in-flight Python exceptions. #3981Performance and style:
(object &&key)
to reference steal the object when using python types as keys. This prevents unnecessary reference count overhead for attr, dictionary, tuple, and sequence look ups. Added additional regression tests. Fixed a performance bug the caused accessor assignments to potentially perform unnecessary copies. #3970make_iterator
. #3980error_guard
to one of the dtors. #3958strip_padding
for numpy. #3994stl_bind.h
bindings now take slice args as a const-ref. #3852PyErr_Restore
is called only once. #3872make_iterator
functions. #3860strdup_gaurd
. #3905misc-definitions-in-headers
,modernize-loop-convert
, andmodernize-use-nullptr
. #3881 #3988Build system improvements:
Backend and tidying up:
#include <iostream>
was removed from thepybind11/stl.h
header. Your project may break if it has a transitive dependency on this include. The fix is to "Include What You Use". #3928setup.py <command>
usage in internal tests. #3734v2.9.2
: Version 2.9.2Compare Source
Changes:
__index__
method on Python <3.8 too. #3700Bug fixes:
PYBIND11_TYPE_CASTER
now uses fully qualified symbols, so it can be used outside ofpybind11::detail
. #3758get_type_override
. #3774VISIBILITY_INLINES_HIDDEN
. #3721Build system improvements:
sysconfig
module to determine installation locations on Python >= 3.10, instead ofdistutils
which has been deprecated. #3764str()
of dtypes. #3682Backend and tidying up:
readability-qualified-auto
,readability-braces-around-statements
,cppcoreguidelines-prefer-member-initializer
,clang-analyzer-optin.performance.Padding
,cppcoreguidelines-pro-type-static-cast-downcast
, andreadability-inconsistent-declaration-parameter-name
. #3702, #3699, #3716, #3709v2.9.1
: Version 2.9.1Compare Source
Changes:
py::raise_from
toTypeError
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. #3605py::raise_from
. This attaches the nested exceptions in Python using the__cause__
field. #3608raise_from
if a pybind11 function runs out of overloads. #3671py::multiple_inheritance
is now only needed when C++ bases are hidden from pybind11. #3650 and #3659Bug fixes:
numpy.h
that causes MSVC C4800 warnings when compiling against Python 3.10 or newer. #3669py::bool_
andpy::float_
asbool
andfloat
respectively. #3622Build system improvements:
CMAKE_ARGS
to override CMake args in pybind11's ownsetup.py
. #3577v2.9.0
: Version 2.9.0Compare Source
This is the last version to support Python 2.7 and 3.5.
New Features:
py::args
to be followed by other arguments; the remaining arguments are implicitly keyword-only, as if apy::kw_only{}
annotation had been used. #3402Changes:
std::string_view
. #3521_
withconst_name
in internals, avoid definingpybind::_
if_
defined as macro (common gettext usage) #3423Bug fixes:
std::forward
calls to somecpp_function
overloads. #3443python dev
label. #3419Eigen::MappedSparseMatrix
withEigen::Map<Eigen::SparseMatrix<...>>
for Eigen 3.3+. #3499Build system improvements:
-g
in$CFLAGS
and$CPPFLAGS
are no longer overridden by.Pybind11Extension
. #3436setup_helpers
. #3548mips64
andppc64le
(reported broken). #3557v2.8.1
: Version 2.8.1Compare Source
v2.8.1 (Oct 27, 2021)
Changes and additions:
py::module_::import("types").attr("SimpleNamespace")
. #3374AttributeError
. Useful for defining custom__setattr__
and__getattr__
methods. #3387Fixes:
std::optional
types. #3376PyCodeObject
on Python 3.9+ (moving toward support for Python 3.11a1) #3368eigen.h
was fixed (originally PR #3343). The bug was unmasked by newly addedstatic_assert
's in the Eigen 3.4.0 release. #3352make_key_iterator
/make_value_iterator
if dereferencing the iterator returned a temporary value instead of a reference. #3348v2.8.0
: Version 2.8.0Compare Source
New features:
py::raise_from
to enable chaining exceptions. #3215register_local_exception_translator(ExceptionTranslator&& translator)
instead ofregister_exception_translator(ExceptionTranslator&& translator)
to keep your exception remapping code local to the module. #2650make_simple_namespace
function for instantiating PythonSimpleNamespace
objects. #2840pybind11::scoped_interpreter
andinitialize_interpreter
have new arguments to allowsys.argv
initialization. #2341view
to view arrays with a different datatype. #987reshape
on arrays. #984__new__
methods on classes by fixing bug preventing overriding methods if they have non-pybind11 siblings. #3265make_value_iterator()
, and fixmake_key_iterator()
to return references instead of copies. #3293bind_map
: #3310.items
from an iterator to a dictionary view..keys
and.values
(both dictionary views).__contains__
to take any object.pybind11::custom_type_setup
was added, for customizing thePyHeapTypeObject
corresponding to a class, which may be useful for enabling garbage collection support, among other things. #3287Changes:
__file__
constant when runningeval_file
in an embedded interpreter. #3233std::optional
now accepted inpy::slice
constructor. #1101str
,bytes
,bytearray
,tuple
,list
now consistently support passingssize_t
values for sizes and indexes. Previously, onlysize_t
was accepted in several interfaces. #3219PYBIND11_TLS_REPLACE_VALUE
arguments more than once. #3290Fixes:
__int__
returning non-int when underlying type is bool or of char type #1334py::cpp_function::initialize
was fixed. #3229pybind11::type_caster
which require lifetime extension, such as forstd::string_view
. #3237Build system improvements:
Backend and tidying up:
std::string
andstd::string_view
now avoids making an extra copy of the data on Python >= 3.3. #3257list
,set
,dict
) such as (clear()
,append()
,insert()
, etc...) and annotated them withpy-non-const
.clang-tidy-const-return
and remove useless consts. #3254 #3194google-explicit-constructor
option was enabled. #3250clang-tidy-readability
rules to make boolean casts explicit improving code readability. Also enabled other misc and readability clang-tidy checks. #3148.pop()
for list. #3116v2.7.1
: Version 2.7.1Compare Source
Minor missing functionality added:
Bug fixes:
.pop()
for list. #3116Backend and tidying up:
v2.7.0
: Version 2.7.0Compare Source
New features:
py::implicitly_convertible<py::none, ...>
forpy::class_
-wrapped types. #3059.char_()
to type which gives the NumPy publicchar
result, which also distinguishes types by bit length (unlike.kind()
). #2864pybind11::bytearray
to manipulatebytearray
similar tobytes
. #2799pybind11/stl/filesystem.h
registers a type caster that, on C++17/Python 3.6+, convertsstd::filesystem::path
topathlib.Path
and anyos.PathLike
tostd::filesystem::path
. #2730PYBIND11_VERSION_HEX
define was added, similar toPY_VERSION_HEX
. #3120Changes:
py::str
changed to exclusively holdPyUnicodeObject
. Previouslypy::str
couldalso hold
bytes
, which is probably surprising, was never documented, and can mask bugs (e.g. accidental use ofpy::str
instead ofpy::bytes
). #2409object_api<>::operator()
(e.g.py::function
__call__
). (This feature is available for Python 3.6+ only.) #2919self
argument in calls to__init__()
. #2914std::string_view
if available to avoid a copy when passing an object to astd::ostream
. #3042iostream.h
documentation; attempts to makepy::scoped_ostream_redirect
thread safe have been removed, as it was only partially effective. #2995Fixes:
const T
inpyarray_t
. #3020simple_collector
/unpacking_collector
. #3013pybind11::builtin_exception
is now explicitly exported, which means the types included/defined in different modules are identical, and exceptions raised in different modules can be caught correctly. The documentation was updated to explain that custom exceptions that are used across module boundaries need to be explicitly exported as well. #2999scoped_ostream_redirect
. #2982setstate
implementation will attempt tosetattr
__dict__
only if the unpickleddict
object is not empty, to not force use ofpy::dynamic_attr()
unnecessarily. #2972std::localtime
. #2846weakref
constructor frompy::object
to create a newweakref
on conversion. #2832shared_ptr
holder from ashared_from_this
class. #2819RuntimeError
when casting frompy::str
tostd::string
. #2903Build system improvements:
setup_helpers.py
, test for platforms that have some multiprocessing features but lack semaphores, whichParallelCompile
requires. #3043pybind11_INCLUDE_DIR
in caseCMAKE_INSTALL_INCLUDEDIR
is absolute. #3005WITH_SOABI
orWITHOUT_SOABI
to CMake. #2938Pybind11Extension
compilation flags with a Mingw64 python. #2921/MP
(ignored flag). #2824pybind11.setup_helpers.intree_extensions
can be used to generatePybind11Extension
instances from cpp files placed in the Pythonpackage source tree. #2831
Backend and tidying up:
Werror
to stricterWerror-all
for Intel compiler and fixed minor issues. #2948_GLIBCXX_USE_CXX11_ABI
. #2956pipx run pybind11 --include
for a quick compile. #3117v2.6.2
: Version 2.6.2Compare Source
Minor missing functionality added:
.disarm
forgil_scoped_acquire
/gil_scoped_release
. #2657Fixed or improved behavior in a few special cases:
object
subclasses would not throw on being passed a Python object of the wrong type. #2701type_caster
for integers does not convert Python objects with__int__
anymore withnoconvert
or during the first round of trying overloads. #2698__index__
is always called and not considered as conversion, consistent with Python 3.8+. #2801Build improvements:
extra_compile_args
andextra_link_args
automatically set by Pybind11Extension are now prepended, which allows them to be overridden by user-setextra_compile_args
andextra_link_args
. #2808--warn-uninitialized
active. #2806STATIC
/SHARED
being ignored in FindPython mode. #2796CMAKE_CXX_VISIBILITY_PRESET
if defined. #2793pybind11::embed
. #2662Bug fixes:
scoped_ostream_redirect
. #2675py::gil_scoped_acquire
assert with CPython 3.9 debug build. #2683Warning fixes:
[-Wshadow-field-in-constructor-modified]
. #2780__init__
/__setstate__
in the tests. #2759Valgrind work:
__init__
on a non-pybind11 class instance. #2755Compiler support:
v2.6.1
: Version 2.6.1Compare Source
py::exec
,py::eval
, andpy::eval_file
now add the builtins module as"__builtins__"
to theirglobals
argument, better matchingexec
andeval
in pure Python. #2616setup_helpers
will no longer set a minimum macOS version higher than the current version. #2622def_buffer
, cleaning up thecapture
object after theclass_
object goes out of scope.#2634
pybind11_INCLUDE_DIRS
was incorrect, potentially causing a regression if it was expected to includePYTHON_INCLUDE_DIRS
(please use targets instead). #2636py::enum_
constructor and methods, avoidingarg0
in the generated docstrings. #2637needs_recompile
optional function to theParallelCompiler
helper, to allow a recompile to be skipped based on a user-defined function. #2643v2.6.0
: Version 2.6.0Compare Source
New features:
py::kw_only()
. #2100py::pos_only()
. #2459py::is_final()
class modifier to block subclassing (CPython only). #2151py::prepend()
, allowing a function to be placed at the beginning of the overload chain. #1131py::type::of<T>()
andpy::type::of(h)
. #2364py::error_already_set::discard_as_unraisable()
. #2372py::hash
is now public. #2217py::class_<union_type>
is now supported. Note that writing to one data member of the union and reading another (type punning) is UB in C++. Thus pybind11-bound enums should never be used for such conversions. #2320.Code correctness features:
__init__
is forgotten on subclasses. #2152py::bytes(o)
whenpy::object o
isn't a bytes instance. #2349str
fails. #2477API changes:
py::module
was renamedpy::module_
to avoid issues with C++20 when used unqualified, but an aliaspy::module
is provided for backward compatibility. #2489py::module_
have been deprecated; please usepybind11::module_::create_extension_module
if you were using the public constructor (fairly rare afterPYBIND11_MODULE
was introduced). #2552PYBIND11_OVERLOAD*
macros andget_overload
function replaced by correctly-namedPYBIND11_OVERRIDE*
andget_override
, fixing inconsistencies in the presence of a closing;
in these macros.get_type_overload
is deprecated. #2325Packaging / building improvements:
build-setuptools
is easier thanks to a newpybind11.setup_helpers
module, which provides utilities to use setuptools with pybind11. It can be used via PEP 518,setup_requires
, or by directly importing or copyingsetup_helpers.py
into your project.pybind11.get_cmake_dir()
orpython -m pybind11 --cmakedir
to get the directory with the CMake configuration files, or include the site-packages location in yourCMAKE_MODULE_PATH
. Or you can use the newpybind11[global]
extra when you installpybind11
, which installs the CMake files and headers into your base environment in the standard location.pybind11-config
is another wayConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.