@@ -15,9 +15,183 @@ IN DEVELOPMENT
1515
1616Changes will be summarized here periodically.
1717
18+ Version 2.12.0 (March 27, 2025)
19+ -------------------------------
20+
21+ New Features:
22+
23+ * ``pybind11 `` now supports compiling for
24+ `NumPy 2 <https://numpy.org/devdocs/numpy_2_0_migration_guide.html >`_. Most
25+ code shouldn't change (see :ref: `upgrade-guide-2.12 ` for details). However,
26+ if you experience issues you can define ``PYBIND11_NUMPY_1_ONLY `` to disable
27+ the new support for now, but this will be removed in the future.
28+ `#5050 <https://github.com/pybind/pybind11/pull/5050 >`_
29+
30+ * ``pybind11/gil_safe_call_once.h `` was added (it needs to be included
31+ explicitly). The primary use case is GIL-safe initialization of C++
32+ ``static `` variables.
33+ `#4877 <https://github.com/pybind/pybind11/pull/4877 >`_
34+
35+ * Support move-only iterators in ``py::make_iterator ``,
36+ ``py::make_key_iterator ``, ``py::make_value_iterator ``.
37+ `#4834 <https://github.com/pybind/pybind11/pull/4834 >`_
38+
39+ * Two simple ``py::set_error() `` functions were added and the documentation was
40+ updated accordingly. In particular, ``py::exception<>::operator() `` was
41+ deprecated (use one of the new functions instead). The documentation for
42+ ``py::exception<> `` was further updated to not suggest code that may result
43+ in undefined behavior.
44+ `#4772 <https://github.com/pybind/pybind11/pull/4772 >`_
45+
46+ Bug fixes:
47+
48+ * Removes potential for Undefined Behavior during process teardown.
49+ `#4897 <https://github.com/pybind/pybind11/pull/4897 >`_
50+
51+ * Improve compatibility with the nvcc compiler (especially CUDA 12.1/12.2).
52+ `#4893 <https://github.com/pybind/pybind11/pull/4893 >`_
53+
54+ * ``pybind11/numpy.h `` now imports NumPy's ``multiarray `` and ``_internal ``
55+ submodules with paths depending on the installed version of NumPy (for
56+ compatibility with NumPy 2).
57+ `#4857 <https://github.com/pybind/pybind11/pull/4857 >`_
58+
59+ * Builtins collections names in docstrings are now consistently rendered in
60+ lowercase (list, set, dict, tuple), in accordance with PEP 585.
61+ `#4833 <https://github.com/pybind/pybind11/pull/4833 >`_
62+
63+ * Added ``py::typing::Iterator<T> ``, ``py::typing::Iterable<T> ``.
64+ `#4832 <https://github.com/pybind/pybind11/pull/4832 >`_
65+
66+ * Render ``py::function `` as ``Callable `` in docstring.
67+ `#4829 <https://github.com/pybind/pybind11/pull/4829 >`_
68+
69+ * Also bump ``PYBIND11_INTERNALS_VERSION `` for MSVC, which unlocks two new
70+ features without creating additional incompatibilities.
71+ `#4819 <https://github.com/pybind/pybind11/pull/4819 >`_
72+
73+ * Guard against crashes/corruptions caused by modules built with different MSVC
74+ versions.
75+ `#4779 <https://github.com/pybind/pybind11/pull/4779 >`_
76+
77+ * A long-standing bug in the handling of Python multiple inheritance was fixed.
78+ See PR #4762 for the rather complex details.
79+ `#4762 <https://github.com/pybind/pybind11/pull/4762 >`_
80+
81+ * Fix ``bind_map `` with ``using `` declarations.
82+ `#4952 <https://github.com/pybind/pybind11/pull/4952 >`_
83+
84+ * Qualify ``py::detail::concat `` usage to avoid ADL selecting one from
85+ somewhere else, such as modernjson's concat.
86+ `#4955 <https://github.com/pybind/pybind11/pull/4955 >`_
87+
88+ * Use new PyCode API on Python 3.12+.
89+ `#4916 <https://github.com/pybind/pybind11/pull/4916 >`_
90+
91+ * Minor cleanup from warnings reported by Clazy.
92+ `#4988 <https://github.com/pybind/pybind11/pull/4988 >`_
93+
94+ * Remove typing and duplicate ``class_ `` for ``KeysView ``/``ValuesView ``/``ItemsView ``.
95+ `#4985 <https://github.com/pybind/pybind11/pull/4985 >`_
96+
97+ * Use ``PyObject_VisitManagedDict() `` and ``PyObject_ClearManagedDict() `` on Python 3.13 and newer.
98+ `#4973 <https://github.com/pybind/pybind11/pull/4973 >`_
99+
100+ * Update ``make_static_property_type() `` to make it compatible with Python 3.13.
101+ `#4971 <https://github.com/pybind/pybind11/pull/4971 >`_
102+
103+ .. fix(types)
104+
105+ * Render typed iterators for ``make_iterator ``, ``make_key_iterator ``,
106+ ``make_value_iterator ``.
107+ `#4876 <https://github.com/pybind/pybind11/pull/4876 >`_
108+
109+ * Add several missing type name specializations.
110+ `#5073 <https://github.com/pybind/pybind11/pull/5073 >`_
111+
112+ * Change docstring render for ``py::buffer ``, ``py::sequence `` and
113+ ``py::handle `` (to ``Buffer ``, ``Sequence ``, ``Any ``).
114+ `#4831 <https://github.com/pybind/pybind11/pull/4831 >`_
115+
116+ * Fixed ``base_enum.__str__ `` docstring.
117+ `#4827 <https://github.com/pybind/pybind11/pull/4827 >`_
118+
119+ * Enforce single line docstring signatures.
120+ `#4735 <https://github.com/pybind/pybind11/pull/4735 >`_
121+
122+ * Special 'typed' wrappers now available in ``typing.h `` to annotate tuple, dict,
123+ list, set, and function.
124+ `#4259 <https://github.com/pybind/pybind11/pull/4259 >`_
125+
126+ * Create ``handle_type_name `` specialization to type-hint variable length tuples.
127+ `#5051 <https://github.com/pybind/pybind11/pull/5051 >`_
128+
129+ .. fix(build)
130+
131+ * Setting ``PYBIND11_FINDPYTHON `` to OFF will force the old FindPythonLibs mechanism to be used.
132+ `#5042 <https://github.com/pybind/pybind11/pull/5042 >`_
133+
134+ * Skip empty ``PYBIND11_PYTHON_EXECUTABLE_LAST `` for the first cmake run.
135+ `#4856 <https://github.com/pybind/pybind11/pull/4856 >`_
136+
137+ * Fix FindPython mode exports & avoid ``pkg_resources `` if
138+ ``importlib.metadata `` available.
139+ `#4941 <https://github.com/pybind/pybind11/pull/4941 >`_
140+
141+ * ``Python_ADDITIONAL_VERSIONS `` (classic search) now includes 3.12.
142+ `#4909 <https://github.com/pybind/pybind11/pull/4909 >`_
143+
144+ * ``pybind11.pc `` is now relocatable by default as long as install destinations
145+ are not absolute paths.
146+ `#4830 <https://github.com/pybind/pybind11/pull/4830 >`_
147+
148+ * Correctly detect CMake FindPython removal when used as a subdirectory.
149+ `#4806 <https://github.com/pybind/pybind11/pull/4806 >`_
150+
151+ * Don't require the libs component on CMake 3.18+ when using
152+ PYBIND11_FINDPYTHON (fixes manylinux builds).
153+ `#4805 <https://github.com/pybind/pybind11/pull/4805 >`_
154+
155+ * ``pybind11_strip `` is no longer automatically applied when
156+ ``CMAKE_BUILD_TYPE `` is unset.
157+ `#4780 <https://github.com/pybind/pybind11/pull/4780 >`_
158+
159+ * Support ``DEBUG_POSFIX `` correctly for debug builds.
160+ `#4761 <https://github.com/pybind/pybind11/pull/4761 >`_
161+
162+ * Hardcode lto/thin lto for Emscripten cross-compiles.
163+ `#4642 <https://github.com/pybind/pybind11/pull/4642 >`_
164+
165+ * Upgrade maximum supported CMake version to 3.27 to fix CMP0148 warnings.
166+ `#4786 <https://github.com/pybind/pybind11/pull/4786 >`_
167+
168+ Documentation:
169+
170+ * Small fix to grammar in ``functions.rst ``.
171+ `#4791 <https://github.com/pybind/pybind11/pull/4791 >`_
172+
173+ * Remove upper bound in example pyproject.toml for setuptools.
174+ `#4774 <https://github.com/pybind/pybind11/pull/4774 >`_
175+
176+ CI:
177+
178+ * CI: Update NVHPC to 23.5 and Ubuntu 20.04.
179+ `#4764 <https://github.com/pybind/pybind11/pull/4764 >`_
180+
181+ * Test on PyPy 3.10.
182+ `#4714 <https://github.com/pybind/pybind11/pull/4714 >`_
183+
184+ Other:
185+
186+ * Use Ruff formatter instead of Black.
187+ `#4912 <https://github.com/pybind/pybind11/pull/4912 >`_
188+
189+ * An ``assert() `` was added to help Coverty avoid generating a false positive.
190+ `#4817 <https://github.com/pybind/pybind11/pull/4817 >`_
191+
18192
19193Version 2.11.1 (July 17, 2023)
20- -----------------------------
194+ ------------------------------
21195
22196Changes:
23197
@@ -32,7 +206,7 @@ Changes:
32206
33207
34208Version 2.11.0 (July 14, 2023)
35- -----------------------------
209+ ------------------------------
36210
37211New features:
38212
0 commit comments