Path to this page:
Subject: CVS commit: pkgsrc/devel/py-pybind11
From: Adam Ciarcinski
Date: 2022-10-05 22:53:35
Message id: 20221005205335.E3942FA90@cvs.NetBSD.org
Log Message:
py-pybind11: updated to 2.10.0
Version 2.10.0
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) to std::set \
(similar to set).
Support bytearray casting to string.
type_caster<std::monostate> was added. std::monostate is a tag type that \
allows std::variant to act as an optional, or allows default construction of a \
std::variant holding a non-default constructible type.
pybind11::capsule::set_name added to mutate the name of the capsule instance.
NumPy: dtype constructor from type number added, accessors corresponding to \
Python API dtype.num, dtype.byteorder, dtype.flags and dtype.alignment added.
Changes:
Python 3.6 is now the minimum supported version.
The minimum version for MSVC is now 2017.
Fix issues with CPython 3.11 betas and add to supported test matrix.
error_already_set is now safer and more performant, especially for exceptions \
with long tracebacks, by delaying computation.
Improve exception handling in python str bindings.
The bindings for capsules now have more consistent exception handling.
PYBIND11_OBJECT_CVT and PYBIND11_OBJECT_CVT_DEFAULT macro can now be used to \
define classes in namespaces other than pybind11.
Error printing code now uses PYBIND11_DETAILED_ERROR_MESSAGES instead of \
requiring NDEBUG, allowing use with release builds if desired.
Implicit conversion of the literal 0 to pybind11::handle is now disabled.
Bug fixes:
Fix exception handling when pybind11::weakref() fails.
module_::def_submodule was missing proper error handling. This is fixed now.
The behavior or error_already_set was made safer and the highly opaque \
"Unknown internal error occurred" message was replaced with a more \
helpful message.
error_already_set::what() now handles non-normalized exceptions correctly.
Support older C++ compilers where filesystem is not yet part of the standard \
library and is instead included in std::experimental::filesystem.
Fix -Wfree-nonheap-object warnings produced by GCC by avoiding returning \
pointers to static objects with return_value_policy::take_ownership.
Fix cast from pytype rvalue to another pytype.
Ensure proper behavior when garbage collecting classes with dynamic attributes \
in Python >=3.9.
A couple long-standing PYBIND11_NAMESPACE \
__attribute__((visibility("hidden"))) inconsistencies are now fixed \
(affects only unusual environments).
pybind11::detail::get_internals() is now resilient to in-flight Python exceptions.
Arrays with a dimension of size 0 are now properly converted to dynamic Eigen \
matrices (more common in NumPy 1.23).
Avoid catching unrelated errors when importing NumPy.
Performance and style:
Added an accessor overload of (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.
Perfect forward all args of make_iterator.
Avoid potential bug in pycapsule destructor by adding an error_guard to one of \
the dtors.
Optimize dictionary access in strip_padding for numpy.
stl_bind.h bindings now take slice args as a const-ref.
Made slice constructor more consistent, and improve performance of some casters \
by allowing reference stealing.
Change numpy dtype from_args method to use const ref.
Follow rule of three to ensure PyErr_Restore is called only once.
Added missing perfect forwarding for make_iterator functions.
Optimize c++ to python function casting by using the rvalue caster.
Optimize Eigen sparse matrix casting by removing unnecessary temporary.
Avoid potential implicit copy/assignment constructors causing double free in \
strdup_gaurd.
Enable clang-tidy checks misc-definitions-in-headers, modernize-loop-convert, \
and modernize-use-nullptr.
Build system improvements:
CMake: Fix file extension on Windows with cp36 and cp37 using FindPython.
CMake: Support multiple Python targets (such as on vcpkg).
CMake: Fix issue with NVCC on Windows.
CMake: Drop the bitness check on cross compiles (like targeting WebAssembly via \
Emscripten).
Add MSVC builds in debug mode to CI.
MSVC 2022 C++20 coverage was added to GitHub Actions, including Eigen.
Backend and tidying up:
New theme for the documentation.
Remove idioms in code comments. Use more inclusive language.
#include <iostream> was removed from the pybind11/stl.h header. Your \
project may break if it has a transitive dependency on this include. The fix is \
to "Include What You Use".
Avoid setup.py <command> usage in internal tests.
Files: