@@ -15,9 +15,159 @@ IN DEVELOPMENT
15
15
16
16
Changes will be summarized here periodically.
17
17
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
+ .. fix(types)
89
+
90
+ * Render typed iterators for ``make_iterator ``, ``make_key_iterator ``,
91
+ ``make_value_iterator ``.
92
+ `#4876 <https://github.com/pybind/pybind11/pull/4876 >`_
93
+
94
+ * Add several missing type name specializations.
95
+ `#5073 <https://github.com/pybind/pybind11/pull/5073 >`_
96
+
97
+ * Change docstring render for ``py::buffer ``, ``py::sequence `` and
98
+ ``py::handle `` (to ``Buffer ``, ``Sequence ``, ``Any ``).
99
+ `#4831 <https://github.com/pybind/pybind11/pull/4831 >`_
100
+
101
+ * Fixed ``base_enum.__str__ `` docstring.
102
+ `#4827 <https://github.com/pybind/pybind11/pull/4827 >`_
103
+
104
+ * Enforce single line docstring signatures.
105
+ `#4735 <https://github.com/pybind/pybind11/pull/4735 >`_
106
+
107
+ * Special 'typed' wrappers now available in typing.h to annotate tuple, dict,
108
+ list, set, and function.
109
+ `#4259 <https://github.com/pybind/pybind11/pull/4259 >`_
110
+
111
+ .. fix(build)
112
+
113
+ * Fix FindPython mode exports & avoid ``pkg_resources `` if
114
+ ``importlib.metadata `` available.
115
+ `#4941 <https://github.com/pybind/pybind11/pull/4941 >`_
116
+
117
+ * ``Python_ADDITIONAL_VERSIONS `` (classic search) now includes 3.12.
118
+ `#4909 <https://github.com/pybind/pybind11/pull/4909 >`_
119
+
120
+ * ``pybind11.pc `` is now relocatable by default as long as install destinations
121
+ are not absolute paths.
122
+ `#4830 <https://github.com/pybind/pybind11/pull/4830 >`_
123
+
124
+ * Correctly detect CMake FindPython removal when used as a subdirectory.
125
+ `#4806 <https://github.com/pybind/pybind11/pull/4806 >`_
126
+
127
+ * Don't require the libs component on CMake 3.18+ when using
128
+ PYBIND11_FINDPYTHON (fixes manylinux builds).
129
+ `#4805 <https://github.com/pybind/pybind11/pull/4805 >`_
130
+
131
+ * ``pybind11_strip `` is no longer automatically applied when
132
+ ``CMAKE_BUILD_TYPE `` is unset.
133
+ `#4780 <https://github.com/pybind/pybind11/pull/4780 >`_
134
+
135
+ * Support DEBUG_POSFIX correctly for debug builds.
136
+ `#4761 <https://github.com/pybind/pybind11/pull/4761 >`_
137
+
138
+ * Hardcode lto/thin lto for Emscripten cross-compiles.
139
+ `#4642 <https://github.com/pybind/pybind11/pull/4642 >`_
140
+
141
+ Documentation:
142
+
143
+ * Small fix to grammar in functions.rst.
144
+ `#4791 <https://github.com/pybind/pybind11/pull/4791 >`_
145
+
146
+ * Remove upper bound in example pyproject.toml for setuptools.
147
+ `#4774 <https://github.com/pybind/pybind11/pull/4774 >`_
148
+
149
+ CI:
150
+
151
+ * CI: Update NVHPC to 23.5 and Ubuntu 20.04.
152
+ `#4764 <https://github.com/pybind/pybind11/pull/4764 >`_
153
+
154
+ * Test on PyPy 3.10.
155
+ `#4714 <https://github.com/pybind/pybind11/pull/4714 >`_
156
+
157
+ Other:
158
+
159
+ * Use new PyCode API on Python 3.12+.
160
+ `#4916 <https://github.com/pybind/pybind11/pull/4916 >`_
161
+
162
+ * Use Ruff formatter instead of Black.
163
+ `#4912 <https://github.com/pybind/pybind11/pull/4912 >`_
164
+
165
+ * An ``assert() `` was added to help Coverty avoid generating a false positive.
166
+ `#4817 <https://github.com/pybind/pybind11/pull/4817 >`_
167
+
18
168
19
169
Version 2.11.1 (July 17, 2023)
20
- -----------------------------
170
+ ------------------------------
21
171
22
172
Changes:
23
173
@@ -32,7 +182,7 @@ Changes:
32
182
33
183
34
184
Version 2.11.0 (July 14, 2023)
35
- -----------------------------
185
+ ------------------------------
36
186
37
187
New features:
38
188
0 commit comments