2023-11-29 11:53:11 by Jonathan Perkin | Files touched by this commit (1) |
Log message:
py-pybind11: Default to python for build only.
This buildlink3.mk has a default DEPMETHOD of "build", so this helps avoid
unwanted indirect buildlink3 dependencies from python.
|
2023-07-17 21:08:10 by Adam Ciarcinski | Files touched by this commit (3) |  |
Log message:
py-pybind11: updated to 2.11.1
Version 2.11.1
Changes:
PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF is now provided as an option for \
disabling the default-on PyGILState_Check()'s in pybind11::handle's inc_ref() \
& dec_ref().
PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF was disabled for PyPy in general (not \
just PyPy Windows).
Version 2.11.0
New features:
The newly added pybind11::detail::is_move_constructible trait can be specialized \
for cases in which std::is_move_constructible does not work as needed. This is \
very similar to the long-established pybind11::detail::is_copy_constructible.
Introduce recursive_container_traits.
pybind11/type_caster_pyobject_ptr.h was added to support automatic wrapping of \
APIs that make use of PyObject *. This header needs to included explicitly (i.e. \
it is not included implicitly with pybind/pybind11.h).
format_descriptor<> & npy_format_descriptor<> PyObject * \
specializations were added. The latter enables py::array_t<PyObject *> \
to/from-python conversions.
buffer_info gained an item_type_is_equivalent_to<T>() member function.
The capsule API gained a user-friendly constructor (py::capsule(ptr, \
"name", dtor)).
Changes:
PyGILState_Check()'s in pybind11::handle's inc_ref() & dec_ref() are now \
enabled by default again.
py::initialize_interpreter() using PyConfig_InitPythonConfig() instead of \
PyConfig_InitIsolatedConfig(), to obtain complete sys.path.
Cast errors now always include Python type information, even if \
PYBIND11_DETAILED_ERROR_MESSAGES is not defined. This increases binary sizes \
slightly (~1.5%) but the error messages are much more informative.
The docstring generation for the std::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.
Setter return values (which are inaccessible for all practical purposes) are no \
longer converted to Python (only to be discarded).
Allow lambda specified to function definition to be noexcept(true) in C++17.
Get rid of recursive template instantiations for concatenating type signatures \
on C++17 and higher.
Compatibility with Python 3.12 (beta). Note that the minimum pybind11 ABI \
version for Python 3.12 is version 5. (The default ABI version for Python \
versions up to and including 3.11 is still version 4.).
With PYBIND11_INTERNALS_VERSION 5 (default for Python 3.12+), MSVC builds use \
std::hash<std::type_index> and std::equal_to<std::type_index> \
instead of string-based type comparisons. This resolves issues when binding \
types defined in the unnamed namespace.
Python exception __notes__ (introduced with Python 3.11) are now added to the \
error_already_set::what() output.
Build system improvements:
CMake 3.27 support was added, CMake 3.4 support was dropped. FindPython will be \
used if FindPythonInterp is not present.
Update clang-tidy to 15 in CI.
Moved the linting framework over to Ruff.
Skip lto checks and target generation when CMAKE_INTERPROCEDURAL_OPTIMIZATION is \
defined.
No longer inject -stdlib=libc++, not needed for modern Pythons (macOS 10.9+).
PyPy 3.10 support was added, PyPy 3.7 support was dropped.
Testing with Python 3.12 beta releases was added.
|
2023-03-17 08:58:06 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message:
py-pybind11: updated to 2.10.4
Version 2.10.4
Changes:
python3 -m pybind11 gained a --version option (prints the version and exits).
Bug Fixes:
Fix a warning when pydebug is enabled on Python 3.11.
Ensure gil_scoped_release RAII is non-copyable.
Ensure the tests dir does not show up with new versions of setuptools.
Better stacklevel for a warning in setuptools helpers.
|
2023-01-11 20:00:31 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message:
py-pybind11: updated to 2.10.3
Version 2.10.3
Changes:
Temporarily made our GIL status assertions (added in 2.10.2) disabled by default \
(re-enable manually by defining PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF, will be \
enabled in 2.11).
Improved error messages when inc_ref/dec_ref are called with an invalid GIL state.
Bug Fixes:
Some minor touchups found by static analyzers.
|
2022-12-28 11:10:14 by Adam Ciarcinski | Files touched by this commit (3) |  |
Log message:
py-pybind11: updated to 2.10.2
Version 2.10.2
Changes:
scoped_interpreter constructor taking PyConfig.
pybind11/eigen/tensor.h adds converters to and from Eigen::Tensor and \
Eigen::TensorMap
PyGILState_Check()'s were integrated to pybind11::handle inc_ref() & \
dec_ref(). The added GIL checks are guarded by \
PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF, which is the default only if NDEBUG is \
not defined.
Add option for enable/disable enum members in docstring.
Fixed typing of KeysView, ValuesView and ItemsView in bind_map.
Bug fixes:
Bug fix affecting only Python 3.6 under very specific, uncommon conditions: move \
PyEval_InitThreads() call to the correct location.
Fix segfault bug when passing foreign native functions to functional.h.
Build system improvements:
Support setting PYTHON_LIBRARIES manually for Windows ARM cross-compilation \
(classic mode).
Extend IPO/LTO detection for ICX (a.k.a IntelLLVM) compiler.
Allow calling find_package(pybind11 CONFIG) multiple times from separate \
directories in the same CMake project and properly link Python (new mode).
multiprocessing_set_spawn in pytest fixture for added safety.
Fixed a bug in two pybind11/tools cmake scripts causing "Unknown arguments \
specified" errors.
|
2022-11-02 09:47:53 by Adam Ciarcinski | Files touched by this commit (3) |  |
Log message:
py-pybind11: updated to 2.10.1
Version 2.10.1
This is the first version to fully support embedding the newly released Python 3.11.
Changes:
Allow pybind11::capsule constructor to take null destructor pointers.
embed.h was changed so that PYTHONPATH is used also with Python 3.11 \
(established behavior).
A PYBIND11_SIMPLE_GIL_MANAGEMENT option was added (cmake, C++ define), along \
with many additional tests in test_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
PYBIND11_EXPORT_EXCEPTION was made non-empty only under macOS. This makes Linux \
builds safer, and enables the removal of warning suppression pragmas for \
Windows.
Bug fixes:
Fixed a bug where UnicodeDecodeError was not propagated from various py::str \
ctors when decoding surrogate utf characters.
Revert perfect forwarding for make_iterator. This broke at least one valid use \
case. May revisit later.
Fix support for safe casts to void* (regression in 2.10.0).
Fix char8_t support (regression in 2.9).
Unicode surrogate character in Python exception message leads to process \
termination in error_already_set::what().
Fix MSVC 2019 v.1924 & C++14 mode error for overload_cast.
Make augmented assignment operators non-const for the object-api. Behavior was \
previously broken for augmented assignment operators.
Add proper error checking to C++ bindings for Python list append and insert.
Work-around for Nvidia's CUDA nvcc compiler in versions 11.4.0 - 11.8.0.
A workaround for PyPy was added in the py::error_already_set implementation, \
related to PR
Fixed compiler errors when C++23 std::forward_like is available.
Properly raise exceptions in contains methods (like when an object in unhashable).
Further improve another error in exception handling.
get_local_internals() was made compatible with finalize_interpreter(), fixing \
potential freezes during interpreter finalization.
Performance and style:
Reserve space in set and STL map casters if possible. This will prevent \
unnecessary rehashing / resizing by knowing the number of keys ahead of time for \
Python to C++ casting. This improvement will greatly speed up the casting of \
large unordered maps and sets.
GIL RAII scopes are non-copyable to avoid potential bugs.
Explicitly default all relevant ctors for pytypes in the PYBIND11_OBJECT macros \
and enforce the clang-tidy checks modernize-use-equals-default in macros as \
well.
Optimize iterator advancement in C++ bindings.
Use the modern PyObject_GenericGetDict and PyObject_GenericSetDict for handling \
dynamic attribute dictionaries.
Document that users should use PYBIND11_NAMESPACE instead of using pybind11 when \
opening namespaces. Using namespace declarations and namespace qualification \
remain the same as pybind11. This is done to ensure consistent symbol \
visibility.
Mark detail::forward_like as constexpr.
Optimize unpacking_collector when processing arg_v arguments.
Optimize casting C++ object to None.
Build system improvements:
CMake: revert overwrite behavior, now opt-in with PYBIND11_PYTHONLIBS_OVERRWRITE OFF.
Include a pkg-config file when installing pybind11, such as in the Python package.
Avoid stripping debug symbols when CMAKE_BUILD_TYPE is set to DEBUG instead of Debug.
Followup to
|
2022-10-05 22:53:35 by Adam Ciarcinski | Files touched by this commit (3) |  |
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.
|
2022-03-31 09:28:01 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message:
py-pybind11: updated to 2.9.2
Version 2.9.2 (Mar 29, 2022)
Changes:
Enum now has an __index__ method on Python <3.8 too.
Local internals are now cleared after finalizing the interpreter.
Bug fixes:
Better support for Python 3.11 alphas.
PYBIND11_TYPE_CASTER now uses fully qualified symbols, so it can be used outside \
of pybind11::detail.
Some fixes for PyPy 3.9.
Fixed a potential memleak in PyPy in get_type_override.
Fix usage of VISIBILITY_INLINES_HIDDEN.
Build system improvements:
Uses sysconfig module to determine installation locations on Python >= 3.10, \
instead of distutils which has been deprecated.
Support Catch 2.13.5+ (supporting GLIBC 2.34+).
Fix test failures with numpy 1.22 by ignoring whitespace when comparing str() of \
dtypes.
Backend and tidying up:
clang-tidy: added readability-qualified-auto, \
readability-braces-around-statements, \
cppcoreguidelines-prefer-member-initializer, \
clang-analyzer-optin.performance.Padding, \
cppcoreguidelines-pro-type-static-cast-downcast, and \
readability-inconsistent-declaration-parameter-name.
clang-format was added to the pre-commit actions, and the entire code base \
automatically reformatted (after several iterations preparing for this leap).
|
2022-02-05 15:53:33 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message:
py-pybind11: updated to 2.9.1
Version 2.9.1
Changes:
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.
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.
Propagate Python exception traceback using raise_from if a pybind11 function \
runs out of overloads.
py::multiple_inheritance is now only needed when C++ bases are hidden from pybind11.
Bug fixes:
Remove a boolean cast in numpy.h that causes MSVC C4800 warnings when compiling \
against Python 3.10 or newer.
Render py::bool_ and py::float_ as bool and float respectively.
Build system improvements:
Fix CMake extension suffix computation on Python 3.10+.
Allow CMAKE_ARGS to override CMake args in pybind11's own setup.py.
Remove a few deprecated c-headers.
More uniform handling of test targets.
Add clang-tidy readability check to catch potentially swapped function args.
|
2022-01-12 07:46:15 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message:
py-pybind11: updated to 2.9.0
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.
Changes:
Make str/bytes/memoryview more interoperable with std::string_view.
Replace _ with const_name in internals, avoid defining pybind::_ if _ defined as \
macro (common gettext usage)
Bug fixes:
Fix a rare warning about extra copy in an Eigen constructor.
Fix caching of the C++ overrides.
Add missing std::forward calls to some cpp_function overloads.
Support PyPy 7.3.7 and the PyPy3.8 beta. Test python-3.11 on PRs with the python \
dev label.
Replace usage of deprecated Eigen::MappedSparseMatrix with \
Eigen::Map<Eigen::SparseMatrix<...>> for Eigen 3.3+.
Tweaks to support Microsoft Visual Studio 2022.
Build system improvements:
Nicer CMake printout and IDE organisation for pybind11's own tests.
CMake: report version type as part of the version string to avoid a spurious \
space in the package status message.
Flags starting with -g in $CFLAGS and $CPPFLAGS are no longer overridden by \
.Pybind11Extension.
Ensure ThreadPool is closed in setup_helpers.
Avoid LTS on mips64 and ppc64le (reported broken).
|