diff --git a/docs/changelog.rst b/docs/changelog.rst index ee79a1871..bb5457eec 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,11 +10,49 @@ Starting with version 1.8.0, pybind11 releases use a `semantic versioning IN DEVELOPMENT -------------- +v2.8.1 (Oct 27, 2021) +--------------------- + +Changes and additions: + * The simple namespace creation shortcut added in 2.8.0 was deprecated due to usage of CPython internal API, and will be removed soon. Use ``py::module_::import("types").attr("SimpleNamespace")``. `#3374 `_ +* Add C++ Exception type to throw and catch ``AttributeError``. Useful for + defining custom ``__setattr__`` and ``__getattr__`` methods. + `#3387 `_ + +Fixes: + +* Fixed the potential for dangling references when using properties with + ``std::optional`` types. + `#3376 `_ + +* Modernize usage of ``PyCodeObject`` on Python 3.9+ (moving toward support for + Python 3.11a1) + `#3368 `_ + +* A long-standing bug in ``eigen.h`` was fixed (originally PR #3343). The bug + was unmasked by newly added ``static_assert``'s in the Eigen 3.4.0 release. + `#3352 `_ + +* Support multiple raw inclusion of CMake helper files (Conan.io does this for + multi-config generators). + `#3420 `_ + +* Fix harmless warning on upcoming CMake 3.22. + `#3368 `_ + +* Fix 2.8.0 regression with MSVC 2017 + C++17 mode + Python 3. + `#3407 `_ + +* Fix 2.8.0 regression that caused undefined behavior (typically + segfaults) in ``make_key_iterator``/``make_value_iterator`` if dereferencing + the iterator returned a temporary value instead of a reference. + `#3348 `_ + v2.8.0 (Oct 4, 2021) -------------------- diff --git a/docs/release.rst b/docs/release.rst index 7fa254eaf..b5de60f4e 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -27,7 +27,7 @@ To release a new version of pybind11: ``include/pybind11/detail/common.h``. PATCH should be a simple integer. - Update the version HEX just below, as well. - Update ``pybind11/_version.py`` (match above) - - Run ``nox -s tests_packaging``` to ensure this was done correctly. + - Run ``nox -s tests_packaging`` to ensure this was done correctly. - Ensure that all the information in ``setup.cfg`` is up-to-date, like supported Python versions. - Add release date in ``docs/changelog.rst``. @@ -50,13 +50,15 @@ To release a new version of pybind11: - Make a GitHub release (this shows up in the UI, sends new release notifications to users watching releases, and also uploads PyPI packages). (Note: if you do not use an existing tag, this creates a new lightweight tag - for you, so you could skip the above step). - - GUI method: click "Create a new release" on the far right, fill in the tag - name (if you didn't tag above, it will be made here), fill in a release - name like "Version X.Y.Z", and optionally copy-and-paste the changelog into - the description (processed as markdown by Pandoc). Check "pre-release" if - this is a beta/RC. You can get partway there with - ``cat docs/changelog.rst | pandoc -f rst -t gfm``. + for you, so you could skip the above step.) + + - GUI method: Under `releases `_ + click "Draft a new release" on the far right, fill in the tag name + (if you didn't tag above, it will be made here), fill in a release name + like "Version X.Y.Z", and copy-and-paste the markdown-formatted (!) changelog + into the description (usually ``cat docs/changelog.rst | pandoc -f rst -t gfm``). + Check "pre-release" if this is a beta/RC. + - CLI method: with ``gh`` installed, run ``gh release create vX.Y.Z -t "Version X.Y.Z"`` If this is a pre-release, add ``-p``. @@ -65,7 +67,7 @@ To release a new version of pybind11: - Update version macros in ``include/pybind11/detail/common.h`` (set PATCH to ``0.dev1`` and increment MINOR). - Update ``_version.py`` to match - - Run ``nox -s tests_packaging``` to ensure this was done correctly. + - Run ``nox -s tests_packaging`` to ensure this was done correctly. - Add a spot for in-development updates in ``docs/changelog.rst``. - ``git add``, ``git commit``, ``git push`` @@ -73,7 +75,7 @@ If a version branch is updated, remember to set PATCH to ``1.dev1``. If you'd like to bump homebrew, run: -.. code-block:: +.. code-block:: console brew bump-formula-pr --url https://github.com/pybind/pybind11/archive/vX.Y.Z.tar.gz diff --git a/tools/pybind11Common.cmake b/tools/pybind11Common.cmake index 7afb0d0b1..69ac4b0f6 100644 --- a/tools/pybind11Common.cmake +++ b/tools/pybind11Common.cmake @@ -20,6 +20,7 @@ Adds the following functions:: #]======================================================] # CMake 3.10 has an include_guard command, but we can't use that yet +# include_guard(global) (pre-CMake 3.10) if(TARGET pybind11::lto) return() endif() diff --git a/tools/pybind11NewTools.cmake b/tools/pybind11NewTools.cmake index 0a7b84706..9e2fd2b40 100644 --- a/tools/pybind11NewTools.cmake +++ b/tools/pybind11NewTools.cmake @@ -5,6 +5,12 @@ # All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +if(CMAKE_VERSION VERSION_LESS 3.12) + message(FATAL_ERROR "You cannot use the new FindPython module with CMake < 3.12") +endif() + +include_guard(GLOBAL) + get_property( is_config TARGET pybind11::headers @@ -16,10 +22,6 @@ else() set(_pybind11_quiet "") endif() -if(CMAKE_VERSION VERSION_LESS 3.12) - message(FATAL_ERROR "You cannot use the new FindPython module with CMake < 3.12") -endif() - if(NOT Python_FOUND AND NOT Python3_FOUND AND NOT Python2_FOUND) diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake index 026069c73..c255e5cfd 100644 --- a/tools/pybind11Tools.cmake +++ b/tools/pybind11Tools.cmake @@ -5,6 +5,11 @@ # All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +# include_guard(global) (pre-CMake 3.10) +if(TARGET pybind11::python_headers) + return() +endif() + # Built-in in CMake 3.5+ include(CMakeParseArguments)