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.1Release Notes
pybind/pybind11 (pybind11)
v2.11.1: Version 2.11.1Compare Source
Changes:
PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREFis now provided as an option for disabling the default-onPyGILState_Check()'s inpybind11::handle'sinc_ref()&dec_ref(). #4753PYBIND11_ASSERT_GIL_HELD_INCREF_DECREFwas 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_constructibletrait can be specialized for cases in whichstd::is_move_constructibledoes not work as needed. This is very similar to the long-establishedpybind11::detail::is_copy_constructible. #4631recursive_container_traits. #4623pybind11/type_caster_pyobject_ptr.hwas 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_infogained anitem_type_is_equivalent_to<T>()member function. #4674capsuleAPI 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_MESSAGESis 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:
FindPythonInterpis not present. #4719ltochecks and target generation whenCMAKE_INTERPROCEDURAL_OPTIMIZATIONis defined. #4643-stdlib=libc++, not needed for modern Pythons (macOS 10.9+). #4639v2.10.4: Version 2.10.4Compare Source
Changes:
python3 -m pybind11gained a--versionoption (prints the version and exits). #4526Bug Fixes:
gil_scoped_releaseRAII 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_refare called with an invalid GIL state. #4427 #4436Bug Fixes:
v2.10.2: Version 2.10.2Compare Source
Changes:
scoped_interpreterconstructor takingPyConfig. #4372pybind11/eigen/tensor.hadds converters to and fromEigen::TensorandEigen::TensorMap#4201PyGILState_Check()'s were integrated topybind11::handleinc_ref()&dec_ref(). The added GIL checks are guarded byPYBIND11_ASSERT_GIL_HELD_INCREF_DECREF, which is the default only ifNDEBUGis not defined. #4246KeysView,ValuesViewandItemsViewinbind_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_spawnin 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::capsuleconstructor to take null destructor pointers. #4221embed.hwas changed so thatPYTHONPATHis used also with Python 3.11 (established behavior). #4119PYBIND11_SIMPLE_GIL_MANAGEMENToption 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_EXCEPTIONwas made non-empty only under macOS. This makes Linux builds safer, and enables the removal of warning suppression pragmas for Windows. #4298Bug fixes:
UnicodeDecodeErrorwas not propagated from variouspy::strctors 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_tsupport (regression in 2.9). #4278error_already_set::what(). #4297overload_cast. #4188py::error_already_setimplementation, related to PR #1895 released with v2.10.0. #4079std::forward_likeis available. #4136get_local_internals()was made compatible withfinalize_interpreter(), fixing potential freezes during interpreter finalization. #4192Performance and style:
PYBIND11_OBJECTmacros and enforce the clang-tidy checksmodernize-use-equals-defaultin macros as well. #4017PyObject_GenericGetDictandPyObject_GenericSetDictfor handling dynamic attribute dictionaries. #4106PYBIND11_NAMESPACEinstead of usingpybind11when opening namespaces. Using namespace declarations and namespace qualification remain the same aspybind11. This is done to ensure consistent symbol visibility. #4098detail::forward_likeas constexpr. #4147arg_varguments. #4219None. #4269Build system improvements:
PYBIND11_PYTHONLIBS_OVERRWRITE OFF. #4195CMAKE_BUILD_TYPEis set toDEBUGinstead 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::frozensetwere added, with copying (cast) tostd::set(similar toset). #3901type_caster<std::monostate>was added.std::monostateis a tag type that allowsstd::variantto act as an optional, or allows default construction of astd::variantholding a non-default constructible type. #3818pybind11::capsule::set_nameadded to mutate the name of the capsule instance. #3866dtype.num,dtype.byteorder,dtype.flagsanddtype.alignmentadded. #3868Changes:
error_already_setis now safer and more performant, especially for exceptions with long tracebacks, by delaying computation. #1895strbindings. #3826PYBIND11_OBJECT_CVTandPYBIND11_OBJECT_CVT_DEFAULTmacro can now be used to define classes in namespaces other than pybind11. #3797PYBIND11_DETAILED_ERROR_MESSAGESinstead of requiringNDEBUG, allowing use with release builds if desired. #39130topybind11::handleis now disabled. #4008Bug fixes:
pybind11::weakref()fails. #3739module_::def_submodulewas missing proper error handling. This is fixed now. #3973error_already_setwas 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-objectwarnings 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_guardto one of the dtors. #3958strip_paddingfor numpy. #3994stl_bind.hbindings now take slice args as a const-ref. #3852PyErr_Restoreis called only once. #3872make_iteratorfunctions. #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.hheader. 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_CASTERnow uses fully qualified symbols, so it can be used outside ofpybind11::detail. #3758get_type_override. #3774VISIBILITY_INLINES_HIDDEN. #3721Build system improvements:
sysconfigmodule to determine installation locations on Python >= 3.10, instead ofdistutilswhich 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_fromtoTypeErrorwhen 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_fromif a pybind11 function runs out of overloads. #3671py::multiple_inheritanceis now only needed when C++ bases are hidden from pybind11. #3650 and #3659Bug fixes:
numpy.hthat causes MSVC C4800 warnings when compiling against Python 3.10 or newer. #3669py::bool_andpy::float_asboolandfloatrespectively. #3622Build system improvements:
CMAKE_ARGSto 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::argsto 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_namein internals, avoid definingpybind::_if_defined as macro (common gettext usage) #3423Bug fixes:
std::forwardcalls to somecpp_functionoverloads. #3443python devlabel. #3419Eigen::MappedSparseMatrixwithEigen::Map<Eigen::SparseMatrix<...>>for Eigen 3.3+. #3499Build system improvements:
-gin$CFLAGSand$CPPFLAGSare no longer overridden by.Pybind11Extension. #3436setup_helpers. #3548mips64andppc64le(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::optionaltypes. #3376PyCodeObjecton Python 3.9+ (moving toward support for Python 3.11a1) #3368eigen.hwas 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_iteratorif dereferencing the iterator returned a temporary value instead of a reference. #3348v2.8.0: Version 2.8.0Compare Source
New features:
py::raise_fromto 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_namespacefunction for instantiating PythonSimpleNamespaceobjects. #2840pybind11::scoped_interpreterandinitialize_interpreterhave new arguments to allowsys.argvinitialization. #2341viewto view arrays with a different datatype. #987reshapeon 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.itemsfrom an iterator to a dictionary view..keysand.values(both dictionary views).__contains__to take any object.pybind11::custom_type_setupwas added, for customizing thePyHeapTypeObjectcorresponding to a class, which may be useful for enabling garbage collection support, among other things. #3287Changes:
__file__constant when runningeval_filein an embedded interpreter. #3233std::optionalnow accepted inpy::sliceconstructor. #1101str,bytes,bytearray,tuple,listnow consistently support passingssize_tvalues for sizes and indexes. Previously, onlysize_twas accepted in several interfaces. #3219PYBIND11_TLS_REPLACE_VALUEarguments more than once. #3290Fixes:
__int__returning non-int when underlying type is bool or of char type #1334py::cpp_function::initializewas fixed. #3229pybind11::type_casterwhich require lifetime extension, such as forstd::string_view. #3237Build system improvements:
Backend and tidying up:
std::stringandstd::string_viewnow 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-returnand remove useless consts. #3254 #3194google-explicit-constructoroption was enabled. #3250clang-tidy-readabilityrules 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 publiccharresult, which also distinguishes types by bit length (unlike.kind()). #2864pybind11::bytearrayto manipulatebytearraysimilar tobytes. #2799pybind11/stl/filesystem.hregisters a type caster that, on C++17/Python 3.6+, convertsstd::filesystem::pathtopathlib.Pathand anyos.PathLiketostd::filesystem::path. #2730PYBIND11_VERSION_HEXdefine was added, similar toPY_VERSION_HEX. #3120Changes:
py::strchanged to exclusively holdPyUnicodeObject. Previouslypy::strcouldalso hold
bytes, which is probably surprising, was never documented, and can mask bugs (e.g. accidental use ofpy::strinstead ofpy::bytes). #2409object_api<>::operator()(e.g.py::function__call__). (This feature is available for Python 3.6+ only.) #2919selfargument in calls to__init__(). #2914std::string_viewif available to avoid a copy when passing an object to astd::ostream. #3042iostream.hdocumentation; attempts to makepy::scoped_ostream_redirectthread safe have been removed, as it was only partially effective. #2995Fixes:
const Tinpyarray_t. #3020simple_collector/unpacking_collector. #3013pybind11::builtin_exceptionis 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. #2982setstateimplementation will attempt tosetattr__dict__only if the unpickleddictobject is not empty, to not force use ofpy::dynamic_attr()unnecessarily. #2972std::localtime. #2846weakrefconstructor frompy::objectto create a newweakrefon conversion. #2832shared_ptrholder from ashared_from_thisclass. #2819RuntimeErrorwhen casting frompy::strtostd::string. #2903Build system improvements:
setup_helpers.py, test for platforms that have some multiprocessing features but lack semaphores, whichParallelCompilerequires. #3043pybind11_INCLUDE_DIRin caseCMAKE_INSTALL_INCLUDEDIRis absolute. #3005WITH_SOABIorWITHOUT_SOABIto CMake. #2938Pybind11Extensioncompilation flags with a Mingw64 python. #2921/MP(ignored flag). #2824pybind11.setup_helpers.intree_extensionscan be used to generatePybind11Extensioninstances from cpp files placed in the Pythonpackage source tree. #2831
Backend and tidying up:
Werrorto stricterWerror-allfor Intel compiler and fixed minor issues. #2948_GLIBCXX_USE_CXX11_ABI. #2956pipx run pybind11 --includefor a quick compile. #3117v2.6.2: Version 2.6.2Compare Source
Minor missing functionality added:
.disarmforgil_scoped_acquire/gil_scoped_release. #2657Fixed or improved behavior in a few special cases:
objectsubclasses would not throw on being passed a Python object of the wrong type. #2701type_casterfor integers does not convert Python objects with__int__anymore withnoconvertor 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_argsandextra_link_argsautomatically set by Pybind11Extension are now prepended, which allows them to be overridden by user-setextra_compile_argsandextra_link_args. #2808--warn-uninitializedactive. #2806STATIC/SHAREDbeing ignored in FindPython mode. #2796CMAKE_CXX_VISIBILITY_PRESETif defined. #2793pybind11::embed. #2662Bug fixes:
scoped_ostream_redirect. #2675py::gil_scoped_acquireassert 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_filenow add the builtins module as"__builtins__"to theirglobalsargument, better matchingexecandevalin pure Python. #2616setup_helperswill no longer set a minimum macOS version higher than the current version. #2622def_buffer, cleaning up thecaptureobject after theclass_object goes out of scope.#2634
pybind11_INCLUDE_DIRSwas incorrect, potentially causing a regression if it was expected to includePYTHON_INCLUDE_DIRS(please use targets instead). #2636py::enum_constructor and methods, avoidingarg0in the generated docstrings. #2637needs_recompileoptional function to theParallelCompilerhelper, 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::hashis 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 oisn't a bytes instance. #2349strfails. #2477API changes:
py::modulewas renamedpy::module_to avoid issues with C++20 when used unqualified, but an aliaspy::moduleis provided for backward compatibility. #2489py::module_have been deprecated; please usepybind11::module_::create_extension_moduleif you were using the public constructor (fairly rare afterPYBIND11_MODULEwas introduced). #2552PYBIND11_OVERLOAD*macros andget_overloadfunction replaced by correctly-namedPYBIND11_OVERRIDE*andget_override, fixing inconsistencies in the presence of a closing;in these macros.get_type_overloadis deprecated. #2325Packaging / building improvements:
build-setuptoolsis easier thanks to a newpybind11.setup_helpersmodule, which provides utilities to use setuptools with pybind11. It can be used via PEP 518,setup_requires, or by directly importing or copyingsetup_helpers.pyinto your project.pybind11.get_cmake_dir()orpython -m pybind11 --cmakedirto 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-configis 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.