https://github.com/pybind/pybind11

sort by:
Revision Author Date Message Commit Date
f33f6af chore(deps): update pre-commit hooks (#5084) * chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v17.0.6 → v18.1.2](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.6...v18.1.2) - [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.3.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.3.5) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0) - [github.com/Lucas-C/pre-commit-hooks: v1.5.4 → v1.5.5](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.4...v1.5.5) - [github.com/sirosen/texthooks: 0.6.4 → 0.6.6](https://github.com/sirosen/texthooks/compare/0.6.4...0.6.6) - [github.com/shellcheck-py/shellcheck-py: v0.9.0.6 → v0.10.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.9.0.6...v0.10.0.1) - [github.com/PyCQA/pylint: v3.0.3 → v3.1.0](https://github.com/PyCQA/pylint/compare/v3.0.3...v3.1.0) - [github.com/python-jsonschema/check-jsonschema: 0.28.0 → 0.28.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.28.0...0.28.1) * style: pre-commit fixes * fix(types): correction for better typing Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com> 02 April 2024, 15:14:08 UTC
7f2214b chore: bump cmake to 3.29 (#5075) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 28 March 2024, 00:11:13 UTC
7af193e chore: get back to work Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 28 March 2024, 00:03:39 UTC
b91b584 docs: remove extra space Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 27 March 2024, 23:53:55 UTC
3e9dfa2 docs: a few missed changes for 2.12 (#5074) 27 March 2024, 23:24:54 UTC
6b5674f chore: prepare 2.12.0 (#5070) * chore: prepare 2.12.0 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: more info on numpy 2 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: mention NumPy 2 in README Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: add release date Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: add 4955 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update changelog.rst * docs: address review comments Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 27 March 2024, 22:09:06 UTC
67c9c56 fix: fully qualify usages of concat to protect against ADL (#4955) * Call concat with proper namespace in cast.h * Apply suggestions from code review * tests: add test for ADL on concat Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: fully qualify all usages of concat Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 27 March 2024, 20:51:03 UTC
0efff79 Bug fixes: Add missing `handle_type_name` specializations. (#5073) * Transfer bug fixes from #4888 wholesale. Full test coverage for all fixes is still missing. * Add cmake option(PYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION) and use in some tests. 27 March 2024, 19:39:05 UTC
705efcc feat: make `numpy.h` compatible with both NumPy 1.x and 2.x (#5050) * API: Make `numpy.h` compatible with both NumPy 1.x and 2.x * TST: Update numpy dtype flags test to not covert flags to char * API: Add `numpy2.h` instead and make `numpy.h` safe This means that users of `numpy.h` cannot be broken, but need to update to `numpy2.h` if they want to compile for NumPy 2. Using Macros simply and didn't bother to try to remove unnecessary code paths. * API: Rather than `numpy2.h` use a define for the user. * Thread `PYBIND11_NUMPY2_SUPPORT` through things and try to adept test matrix * Small fixups (shouldn't matter)? * Fixup. Does upgrading scipy help? (it shouldn't?) (Some other small fixup) * Use NumPy 2 nightlies for ubuntu-latest job also * BUG: Fix numpy.bool check * TST: Fix complexwarning * BUG: Fix the fact that only the 50 slot is filled with the copy alias (There were 3 functions all doing the same, only this slot survived 2.x) * TST: One more test tweak * TST: Use "long" name for long, since it changed on windows * TST: Apparently we didn't always have ulong, so just use `L` * TST: Enforce dtype='l' for test as default isn't long anymore on windows * Rename macro and invert logic to PYBIND11_NUMPY_1_ONLY * PYBIND11_INTERNAL_NUMPY_1_ONLY_DETECTED * Test and code comment expansion * CI: Use pre-releases of numpy/scipy from pip via explicit version * CI: NumPy 2 only available on almalinux (as it is Python >=3.9) * MAINT: Match name more exactly and adopt error phrasing * MAINT: Pushed early, move helper to be private member * fix error message compilation when using NumPy 1.x-only backcompat * silence name shadowing warning * chore: minor optimization Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com> 26 March 2024, 22:20:11 UTC
e0f2c71 tests: hide warning on clang (#5069) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 26 March 2024, 17:57:05 UTC
65370f3 Create handle_type_name specialization to type-hint variable length tuples (#5051) 21 March 2024, 07:24:19 UTC
ddb8b67 fix(cmake): allow forcing old FindPython (#5042) 21 March 2024, 07:23:57 UTC
ec73bda ci: skipping test for Windows Clang failure (#5062) * ci: trying things for Windows Clang failure Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * WIP: try using older clang Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: skip broken test Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: try to skip test in tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix(tests): Prefer __version__ over MSVC Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * chore: avoid warning on Clang Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update tests/test_exceptions.py * Update tests/test_exceptions.py --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 21 March 2024, 06:27:58 UTC
8b48ff8 chore(deps): bump the actions group with 3 updates (#5024) Bumps the actions group with 3 updates: [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake), [actions/cache](https://github.com/actions/cache) and [pre-commit/action](https://github.com/pre-commit/action). Updates `jwlawson/actions-setup-cmake` from 1.14 to 2.0 - [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases) - [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.14...v2.0) Updates `actions/cache` from 3 to 4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) Updates `pre-commit/action` from 3.0.0 to 3.0.1 - [Release notes](https://github.com/pre-commit/action/releases) - [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: jwlawson/actions-setup-cmake dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: pre-commit/action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 14 February 2024, 01:50:51 UTC
0518bf9 ci: ignore actions/checkout until v5 comes out 13 February 2024, 23:36:39 UTC
e84d446 ci: Ignore v1 updates for checkout (#5023) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 13 February 2024, 23:29:42 UTC
416f7a4 chore(deps): update pre-commit hooks (#5018) updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0) - [github.com/sirosen/texthooks: 0.6.3 → 0.6.4](https://github.com/sirosen/texthooks/compare/0.6.3...0.6.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 06 February 2024, 07:07:31 UTC
768cebe doc: add litgen to the automatic generators list (compiling.rst) (#5012) * doc: add litgen to the automatic generators list (compiling.rst) Added this: [litgen]_ is an automatic python bindings generator with a focus on generating documented and discoverable bindings: bindings will nicely reproduce the documentation found in headers. It is is based on srcML (srcml.org), a highly scalable, multi-language parsing tool with a developer centric approach. The API that you want to expose to python must be C++14 compatible (but your implementation can use more modern constructs). .. [litgen] https://pthom.github.io/litgen * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 28 January 2024, 17:10:03 UTC
869cc1f install mingw-w64-${{matrix.env}}-python-scipy only for mingw64 (#5006) 17 January 2024, 05:09:20 UTC
39e65e1 ci: group dependabot updates (#4986) 13 January 2024, 20:28:39 UTC
31b7e14 bugfix: removing typing and duplicate ``class_`` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) * remove typing for KeysView/ValuesView/ItemsView * add tests for map view types 13 January 2024, 19:07:36 UTC
aec6cc5 fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856) * fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run * style: pre-commit fixes * Update pybind11NewTools.cmake * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 08 January 2024, 13:40:41 UTC
f29def9 chore(deps): update pre-commit hooks (#4994) updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.1.9) - [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.8.0) - [github.com/PyCQA/pylint: v3.0.1 → v3.0.3](https://github.com/PyCQA/pylint/compare/v3.0.1...v3.0.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 02 January 2024, 03:25:58 UTC
b583336 chore(deps): bump ilammy/msvc-dev-cmd from 1.12.1 to 1.13.0 (#4995) Bumps [ilammy/msvc-dev-cmd](https://github.com/ilammy/msvc-dev-cmd) from 1.12.1 to 1.13.0. - [Release notes](https://github.com/ilammy/msvc-dev-cmd/releases) - [Commits](https://github.com/ilammy/msvc-dev-cmd/compare/v1.12.1...v1.13.0) --- updated-dependencies: - dependency-name: ilammy/msvc-dev-cmd dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 02 January 2024, 02:51:02 UTC
976fea0 Fix Clazy warnings (#4988) * stl.h: Use C++11 range-loops with const reference This saves copy-ctor and dtor for non-trivial types by value Found by clazy (range-loop-reference) * test_smart_ptr.cpp cleanup Introduce `pointer_set<T>` https://github.com/boostorg/unordered/issues/139 > Based on the standard, the first move should leave a in a "valid but unspecified state"; --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 30 December 2023, 05:59:47 UTC
eeac2f4 chore(deps): bump actions/upload-artifact from 3 to 4 (#4975) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 15 December 2023, 02:50:09 UTC
e8a43ea chore(deps): bump actions/download-artifact from 3 to 4 (#4976) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 15 December 2023, 02:46:13 UTC
dc477fa fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) * fix: Use PyObject_VisitManagedDict() of Python 3.13 Use PyObject_VisitManagedDict() and PyObject_ClearManagedDict() in pybind11_traverse() and pybind11_clear() on Python 3.13 and newer. * Add Python 3.13 CI * tests: don't get numpy/scipy on 3.13 yet * ci: move 3.13 to upstream Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 15 December 2023, 02:42:55 UTC
daea113 fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) * Upgrade maximum supported CMake version to 3.27 to fix warning with CMP0148 policy (#4785) * Update `macos_brew_install_llvm` pipeline to use expected Python installation * Fix `Python_EXECUTABLE` Cmake variable typo * Apply suggestions from code review * fix: use FindPython for CMake 3.18+ by default for pybind11's tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: fix issues with finding Python Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: also set executable on subdir tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix(cmake): correct logic for FindPython Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update ci.yml * Revert "Update ci.yml" This reverts commit 33798adf3f3892ac4b78da8d3d91d3b27611bbe5. --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 14 December 2023, 19:36:45 UTC
7d538a4 fix: make_static_property_type() (#4971) Update make_static_property_type() to make it compatible with Python 3.13: set Py_TPFLAGS_MANAGED_DICT flag before calling PyType_Ready(). 14 December 2023, 14:36:25 UTC
6832289 chore(deps): bump actions/setup-python from 4 to 5 (#4965) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 07 December 2023, 05:09:08 UTC
c1e06f5 chore(deps): update pre-commit hooks (#4963) updates: - [github.com/pre-commit/mirrors-clang-format: v17.0.4 → v17.0.6](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.4...v17.0.6) - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.6) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.1) - [github.com/sirosen/texthooks: 0.6.2 → 0.6.3](https://github.com/sirosen/texthooks/compare/0.6.2...0.6.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 05 December 2023, 16:58:06 UTC
a67d786 fix(stl_bind): Enable `bind_map` with `using` declarations. (#4952) * Enable `bind_map` with `using` declarations. * style: pre-commit fixes * Enable directives in bind_vector * Add tests for bind_ and using directives * style: pre-commit fixes * Remove C++17 functions * Fix test comment * Add minimal user like map py test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 29 November 2023, 20:56:25 UTC
4bb6163 chore(deps): bump deadsnakes/action from 3.0.1 to 3.1.0 (#4951) Bumps [deadsnakes/action](https://github.com/deadsnakes/action) from 3.0.1 to 3.1.0. - [Release notes](https://github.com/deadsnakes/action/releases) - [Commits](https://github.com/deadsnakes/action/compare/v3.0.1...v3.1.0) --- updated-dependencies: - dependency-name: deadsnakes/action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 27 November 2023, 23:37:43 UTC
dc9b395 pybind11.pc: use pcfiledir for relative destinations (#4830) * pybind11.pc: use pcfiledir for relative destinations If the datarootdir is absolute, just use the absolute path directly. However, if it is relative, we can compute the prefix from the location of the `.pc` file itself. This allows the install to be relocatable. * chore: use 3.20's cmake_path if available * style: pre-commit fixes * Update CMakeLists.txt --------- Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 16 November 2023, 05:55:14 UTC
9591cfb fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941) * fix(cmake): findpython issues and 3.12 support for pybind11_find_import Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update pybind11NewTools.cmake --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 16 November 2023, 05:54:47 UTC
6831666 ci: add more versions of numpy/scipy/pypy (#4714) * ci: add more versions of numpy/scipy/pypy Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Apply suggestions from code review * style: pre-commit fixes * Update requirements.txt * Update requirements.txt * Apply suggestions from code review --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 16 November 2023, 05:52:05 UTC
6cf90e7 fix(cmake): avoid really slow compile on emscripten (#4642) * fix: avoid really slow compile on emscripten Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update tools/pybind11Common.cmake --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 16 November 2023, 05:50:15 UTC
b389ae7 chore: update changelog script for categories (#4942) 15 November 2023, 23:59:07 UTC
e250155 Fix a long-standing bug in the handling of Python multiple inheritance (#4762) * Equivalent of https://github.com/google/clif/commit/5718e4d0807fd3b6a8187dde140069120b81ecef * Resolve clang-tidy errors. * Moving test_PPCCInit() first changes the behavior! * Resolve new Clang dev C++11 errors: ``` The CXX compiler identification is Clang 17.0.0 ``` ``` pytypes.h:1615:23: error: identifier '_s' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] ``` ``` cast.h:1380:26: error: identifier '_a' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] ``` * Resolve gcc 4.8.5 error: ``` pytypes.h:1615:12: error: missing space between '""' and suffix identifier ``` * Specifically exclude `__clang__` * Snapshot of debugging code (does NOT pass pre-commit checks). * Revert "Snapshot of debugging code (does NOT pass pre-commit checks)." This reverts commit 1d4f9ff2632b32ddcb0dc7ecd0ab7a4ce4c15a4e. * [ci skip] Order Dependence Demo * Revert "[ci skip] Order Dependence Demo" This reverts commit d37b5409d4e5b835620ccbb321a4e1ba89af315c. * One way to deal with the order dependency issue. This is not the best way, more like a proof of concept. * Move test_PC() first again. * Add `all_type_info_add_base_most_derived_first()`, use in `all_type_info_populate()` * Revert "One way to deal with the order dependency issue. This is not the best way, more like a proof of concept." This reverts commit eb09c6c1b978208ceee40f05bbe75491b6ff8ad6. * clang-tidy fixes (automatic) * Add `is_redundant_value_and_holder()` and use to avoid forcing `__init__` overrides when they are not needed. * Streamline implementation and avoid unsafe `reinterpret_cast<instance *>()` introduced with PR #2152 The `reinterpret_cast<instance *>(self)` is unsafe if `__new__` is mocked, which was actually found in the wild: the mock returned `None` for `self`. This was inconsequential because `inst` is currently cast straight back to `PyObject *` to compute `all_type_info()`, which is empty if `self` is not a pybind11 `instance`, and then `inst` is never dereferenced. However, the unsafe detour through `instance *` is easily avoided and the updated implementation is less prone to accidents while debugging or refactoring. * Fix actual undefined behavior exposed by previous changes. It turns out the previous commit message is incorrect, the `inst` pointer is actually dereferenced, in the `value_and_holder` ctor here: https://github.com/pybind/pybind11/blob/f3e0602802c7840992c97f4960515777cad6a5c7/include/pybind11/detail/type_caster_base.h#L262-L263 ``` 259 // Main constructor for a found value/holder: 260 value_and_holder(instance *i, const detail::type_info *type, size_t vpos, size_t index) 261 : inst{i}, index{index}, type{type}, 262 vh{inst->simple_layout ? inst->simple_value_holder 263 : &inst->nonsimple.values_and_holders[vpos]} {} ``` * Add test_mock_new() * Experiment: specify indirect bases * Revert "Experiment: specify indirect bases" This reverts commit 4f90d85f9fc15290d6be54d5ae9417bd131b84d9. * Add `all_type_info_check_for_divergence()` and some tests. * Call `all_type_info_check_for_divergence()` also from `type_caster_generic::load_impl<>` * Resolve clang-tidy error: ``` include/pybind11/detail/type_caster_base.h:795:21: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors] if (matching_bases.size() != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ !matching_bases.empty() ``` * Revert "Resolve clang-tidy error:" This reverts commit df27188dc6d6cf333145755543f56b2f6657aa5e. * Revert "Call `all_type_info_check_for_divergence()` also from `type_caster_generic::load_impl<>`" This reverts commit 5f5fd6a68e3cff1726628f6dea8e1c0754636a23. * Revert "Add `all_type_info_check_for_divergence()` and some tests." This reverts commit 0a9599f775bfd3ca196c5e23a3fcf2890cbf6e82. 08 November 2023, 20:44:04 UTC
2c35fde Fix refcount bug introduced with PR #4916. (#4927) https://github.com/pybind/pybind11/pull/4916/files#r1387035547 08 November 2023, 19:16:10 UTC
c758b81 chore: move to ruff-format (#4912) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 08 November 2023, 07:42:54 UTC
0a974fe chore(deps): update pre-commit hooks (#4923) updates: - [github.com/pre-commit/mirrors-clang-format: v17.0.3 → v17.0.4](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.3...v17.0.4) - [github.com/astral-sh/ruff-pre-commit: v0.1.2 → v0.1.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.2...v0.1.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 08 November 2023, 06:59:52 UTC
f260693 Use newer PyCode API and other fixes (#4916) * Use PyCode API * style: pre-commit fixes * Free locals * Fix PY_VERSION_HEX check --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 05 November 2023, 22:08:32 UTC
31b0a5d fix doc typo 04 November 2023, 03:51:16 UTC
76b7f53 Python_ADDITIONAL_VERSIONS: 3.12 (#4909) Add 3.12 to the default `Python_ADDITIONAL_VERSIONS`. 01 November 2023, 02:56:16 UTC
a18c10f fix(cmake): make library component optional (#4805) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 27 October 2023, 15:02:05 UTC
3aece81 chore: update hooks and Ruff config (#4904) Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 27 October 2023, 05:26:28 UTC
1e28599 fix: Add missing spaces to error string (#4906) * [minor] Add a missing space Add a missing space to error message * Add space after period, always add newline. 27 October 2023, 03:40:19 UTC
fa27d2f Adapt to changed function name in Python 3.13 (#4902) According to https://docs.python.org/3.13/whatsnew/3.13.html: Add PyThreadState_GetUnchecked() function: similar to PyThreadState_Get(), but don't kill the process with a fatal error if it is NULL. The caller is responsible to check if the result is NULL. Previously, the function was private and known as _PyThreadState_UncheckedGet(). 24 October 2023, 16:46:26 UTC
bf88e29 Bug fix: Replace bare `static exception<T>` with `gil_safe_call_once_and_store`. (#4897) This is to ensure that `Py_DECREF()` is not called after the Python interpreter was finalized already: https://github.com/pybind/pybind11/blob/3414c56b6c7c521d868c9a137ca2ace2e26b5b2e/include/pybind11/gil_safe_call_once.h#L19 23 October 2023, 19:51:04 UTC
3414c56 Workaround NVCC parse failure in `cast_op` (#4893) * Workaround NVCC parse failure in `cast_op` There is a bug in some CUDA versions (observed in CUDA 12.1 and 11.7 w/ GCC 12.2), that makes `cast_op` fail to compile: `cast.h:45:120: error: expected template-name before ‘<’ token` Defining the nested type as an alias and using it allows this to work without any change in semantics. Fixes #4606 * style: pre-commit fixes * Add comments to result_t referencing PR --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 21 October 2023, 17:50:14 UTC
7969049 Comment out failing job, with link to #4889 (#4890) 20 October 2023, 06:12:37 UTC
74439a6 feature: Use typed iterators in `make_*iterator` (#4876) 17 October 2023, 19:04:46 UTC
0cbd92b Update pytest to version 7.2.0 (which removes their dependency on py) (#4880) * Update pytest (which removes their dependency on py) The py library through 1.11.0 for Python allows remote attackers to conduct a ReDoS (Regular expression Denial of Service) attack via a Subversion repository with crafted info data, because the InfoSvnCommand argument is mishandled. The particular codepath in question is the regular expression at py._path.svnurl.InfoSvnCommand.lspattern and is only relevant when dealing with subversion (svn) projects. Notably the codepath is not used in the popular pytest project. The developers of the pytest package have released version 7.2.0 which removes their dependency on py. Users of pytest seeing alerts relating to this advisory may update to version 7.2.0 of pytest to resolve this issue. See https://github.com/pytest-dev/py/issues/287#issuecomment-1290407715 for additional context. * Added conditions so that we keep using 7.0.0 on python 3.6 16 October 2023, 14:42:30 UTC
0e2c3e5 Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy.h) (#4877) * LazyInitializeAtLeastOnceDestroyNever v1 * Go back to using `union` as originally suggested by jbms@. The trick (also suggested by jbms@) is to add empty ctor + dtor. * Revert "Go back to using `union` as originally suggested by jbms@. The trick (also suggested by jbms@) is to add empty ctor + dtor." This reverts commit e7b8c4f0fcd72191e88d1c17abf5da08fe3a9c6f. * Remove `#include <stdalign.h>` * `include\pybind11/numpy.h(24,10): fatal error C1083: Cannot open include file: 'stdalign.h': No such file or directory` * @tkoeppe wrote: this is a C interop header (and we're not writing C) * Suppress gcc 4.8.5 (CentOS 7) warning. ``` include/pybind11/eigen/../numpy.h:63:53: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] return *reinterpret_cast<T *>(value_storage_); ^ ``` * Replace comments: Document PRECONDITION. Adopt comment suggested by @tkoeppe: https://github.com/pybind/pybind11/pull/4877#discussion_r1350356093 * Adopt suggestion by @tkoeppe: * https://github.com/pybind/pybind11/pull/4877#issuecomment-1752969127 * https://godbolt.org/z/Wa79nKz6e * Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases: ``` g++ -o pybind11/tests/test_numpy_array.os -c -std=c++20 -fPIC -fvisibility=hidden -O0 -g -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor -Wunused-result -Werror -isystem /usr/include/python3.11 -isystem /usr/include/eigen3 -DPYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX -DPYBIND11_ENABLE_TYPE_CASTER_ODR_GUARD_IF_AVAILABLE -DPYBIND11_TEST_BOOST -Ipybind11/include -I/usr/local/google/home/rwgk/forked/pybind11/include -I/usr/local/google/home/rwgk/clone/pybind11/include /usr/local/google/home/rwgk/forked/pybind11/tests/test_numpy_array.cpp ``` ``` In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_numpy_array.cpp:10: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h: In static member function ‘static pybind11::detail::npy_api& pybind11::detail::npy_api::get()’: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h:258:82: error: ‘constinit’ variable ‘api_init’ does not have a constant initializer 258 | PYBIND11_CONSTINIT static LazyInitializeAtLeastOnceDestroyNever<npy_api> api_init; | ^~~~~~~~ ``` ``` In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_numpy_array.cpp:10: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h: In static member function ‘static pybind11::object& pybind11::dtype::_dtype_from_pep3118()’: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h:697:13: error: ‘constinit’ variable ‘imported_obj’ does not have a constant initializer 697 | imported_obj; | ^~~~~~~~~~~~ ``` * Revert "Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases:" This reverts commit f07b28bda9f91fb723aa898a21c81b6dd6857072. * Reapply "Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases:" This reverts commit 36be645758aa82b576d24003808386bec6e55bf9. * Add Default Member Initializer on `value_storage_` as suggested by @tkoeppe: https://github.com/pybind/pybind11/pull/4877#issuecomment-1753201342 This fixes the errors reported under commit f07b28bda9f91fb723aa898a21c81b6dd6857072. * Fix copy-paste-missed-a-change mishap in commit 88cec1152ab5576db19bab95c484672f06f5989a. * Semi-paranoid placement new (based on https://github.com/pybind/pybind11/pull/4877#discussion_r1350573114). * Move PYBIND11_CONSTINIT to detail/common.h * Move code to the right places, rename new class and some variables. * Fix oversight: update tests/extra_python_package/test_files.py * Get the name right first. * Use `std::call_once`, `std::atomic`, following a pattern developed by @tkoeppe * Make the API more self-documenting (and possibly more easily reusable). * google-clang-tidy IWYU fixes * Rewrite comment as suggested by @tkoeppe * Update test_exceptions.cpp and exceptions.rst * Fix oversight in previous commit: add `PYBIND11_CONSTINIT` * Make `get_stored()` non-const for simplicity. As suggested by @tkoeppe: not seeing any reasonable use in which `get_stored` has to be const. * Add comment regarding `KeyboardInterrupt` behavior, based heavily on information provided by @jbms. * Add `assert(PyGILState_Check())` in `gil_scoped_release` ctor (simple & non-simple implementation) as suggested by @EthanSteinberg. * Fix oversight in previous commit (missing include cassert). * Remove use of std::atomic, leaving comments with rationale, why it is not needed. * Rewrite comment re `std:optional` based on deeper reflection (aka 2nd thoughts). * Additional comment with the conclusion of a discussion under PR #4877. * https://github.com/pybind/pybind11/pull/4877#issuecomment-1757363179 * Small comment changes suggested by @tkoeppe. 12 October 2023, 04:05:31 UTC
6c77208 chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (#4875) Bumps [seanmiddleditch/gha-setup-ninja](https://github.com/seanmiddleditch/gha-setup-ninja) from 3 to 4. - [Release notes](https://github.com/seanmiddleditch/gha-setup-ninja/releases) - [Commits](https://github.com/seanmiddleditch/gha-setup-ninja/compare/v3...v4) --- updated-dependencies: - dependency-name: seanmiddleditch/gha-setup-ninja dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 06 October 2023, 04:21:22 UTC
2b2e4ca chore(deps): update pre-commit hooks (#4868) * chore(deps): update pre-commit hooks updates: - [github.com/psf/black-pre-commit-mirror: 23.7.0 → 23.9.1](https://github.com/psf/black-pre-commit-mirror/compare/23.7.0...23.9.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.287...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/shellcheck-py/shellcheck-py: v0.9.0.5 → v0.9.0.6](https://github.com/shellcheck-py/shellcheck-py/compare/v0.9.0.5...v0.9.0.6) - [github.com/PyCQA/pylint: v3.0.0a7 → v3.0.0](https://github.com/PyCQA/pylint/compare/v3.0.0a7...v3.0.0) * Update .pre-commit-config.yaml * style: pre-commit fixes * Update .pre-commit-config.yaml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 03 October 2023, 17:13:44 UTC
dd64df7 MAINT: Remove np.int_ (#4867) 03 October 2023, 16:12:58 UTC
0a756c0 MAINT: Include `numpy._core` imports (#4857) * MAINT: Include numpy._core imports * style: pre-commit fixes * Apply review comments * style: pre-commit fixes * Add no-inline attribute * Select submodule name based on numpy version * style: pre-commit fixes * Update pre-commit check * Add error_already_set and simplify if statement * Update .pre-commit-config.yaml Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com> 27 September 2023, 17:22:04 UTC
f468b07 Add 2 missing `throw error_already_set();` (#4863) Fixes oversights in PR #4570. 27 September 2023, 16:55:49 UTC
7e5edbc Avoid copy in iteration by using const auto & (#4861) This change is fixing a Coverity AUTO_CAUSES_COPY issues. 25 September 2023, 15:38:21 UTC
5891867 fix(cmake): support DEBUG_POSTFIX correctly (#4761) * cmake: split extension Into suffix and debug postfix. Pybind11 is currently treating both as suffix, which is problematic when something else defines the DEBUG_POSTFIX because they will be concatenated. pybind11_extension sets SUFFIX to _d.something and if DEBUG_POSTFIX is set to _d. _d + _d.something = _d_d.something The issue has been reported at: https://github.com/pybind/pybind11/issues/4699 * style: pre-commit fixes * fix(cmake): support postfix for old FindPythonInterp mode too Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com> 15 September 2023, 22:05:43 UTC
4fb111b fix(cmake): correctly detect FindPython policy and better warning (#4806) 15 September 2023, 21:59:30 UTC
d06d536 Fix small bug introduced with PR #4735 (#4845) * Bug fix: `result[0]` called if `result.empty()` * Add unit test that fails without the fix. 14 September 2023, 16:47:34 UTC
8c7b8dd fix: Missing typed variants of `iterator` and `iterable` (#4832) 12 September 2023, 19:48:27 UTC
b457367 Update render for buffer sequence and handle (#4831) * fix: Add capitalize render name of `py::buffer` and `py::sequence` * fix: Render `py::handle` same way as `py::object` * tests: Fix tests `handle` -> `object` * tests: Test capitaliation of `py::sequence` and `py::buffer` * style: pre-commit fixes * fix: Render `py::object` as `Any` * Revert "fix: Render `py::object` as `Any`" This reverts commit 7861dcfabb78ac210b4c67c35a0d47fb67525a96. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 12 September 2023, 19:47:39 UTC
c9149d9 fix: Use lowercase builtin collection names (#4833) 12 September 2023, 19:46:58 UTC
c836059 feature: Support move-only iterators in `py::make_*iterator` (#4834) * feature: Support move-only iterators in `py::make_*iterator` * fix: Missing static assertion message * fixup: Missing `explicit` in single argument constructors * fix: Simplify tests: make existing iterator move-only * fix: Missing `noexcept` 07 September 2023, 12:57:39 UTC
4a2f7e4 chore(deps): bump actions/checkout from 1 to 4 (#4836) * chore(deps): bump actions/checkout from 1 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v1...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update .github/workflows/ci.yml * actions/checkout@v1 for centos:7 * Fix oversight: centos:7 actually works with actions/checkout@v3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 06 September 2023, 19:57:18 UTC
467fe27 chore(deps): update pre-commit hooks (#4838) * chore(deps): update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.287](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.281...v0.0.287) - [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.1) - [github.com/asottile/blacken-docs: 1.15.0 → 1.16.0](https://github.com/asottile/blacken-docs/compare/1.15.0...1.16.0) - [github.com/Lucas-C/pre-commit-hooks: v1.5.1 → v1.5.4](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.1...v1.5.4) - [github.com/PyCQA/pylint: v3.0.0a6 → v3.0.0a7](https://github.com/PyCQA/pylint/compare/v3.0.0a6...v3.0.0a7) * style: pre-commit fixes * Update pyproject.toml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 06 September 2023, 13:04:27 UTC
c9638a1 Help Coverty avoid generating a false positive. (#4817) * Change variable name `it` to `curr_overl` to improve readability, add `assert()` in the only place where `curr_overl` could become `nullptr`. * Move the `assert()` to where Coverty generates a false positive. * variable name as suggested by @henryiii 01 September 2023, 18:31:22 UTC
db412e6 fix: Render `py::function` as `Callable` (#4829) * fix: Render `py::function` as `Callable` * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 31 August 2023, 05:43:01 UTC
e705fb5 Fix enum's `__str__` docstring (#4827) * fix: Enum __str__ function name * tests: Test enum.__str__.__doc__ 30 August 2023, 21:20:46 UTC
1adac5a `PYBIND11_INTERNALS_VERSION` bump for MSVC, piggy-backed on PR #4779. See comments there. (#4819) 30 August 2023, 17:05:24 UTC
76b8858 fix: Different MSVC versions may be ABI incompatible, guard with _MSC_VER (#2898) (#4779) 23 August 2023, 16:49:35 UTC
b9359ce Remove newlines from docstring signature (#4735) * Remove newlines from docstring signature * Jean/dev (#1) Replace newlines in arg values with spaces * style: pre-commit fixes * Don't use std::find_if for C++ 11 compatibility * Avoid implicit char to bool conversion * Test default arguments for line breaks * style: pre-commit fixes * Separate Eigen tests * style: pre-commit fixes * Fix merge * Try importing numpy * Avoid unreferenced variable in catch block * style: pre-commit fixes * Update squash function * Reduce try block * Additional test cases * style: pre-commit fixes * Put statement inside braces * Move string into function body * Rename repr for better readability. Make constr explicit. * Add multiline string default argument test case * style: pre-commit fixes * Add std namespace, do not modify string repr * Test for all space chars, test str repr not modified --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 15 August 2023, 14:48:59 UTC
f47ff32 Fix grammar in functions.rst (#4791) The previous sentence had an extra "a" before "several", which isn't right. 15 August 2023, 14:09:13 UTC
80bcd21 [ci skip] Adopt nanobind config. (#4792) 15 August 2023, 14:02:54 UTC
add281a Migrate to readthedocs configuration file v2¶ (#4789) * Copy of recommded readthedocs configuration file v2 * [ci skip] It is now requirements (not requirements_file) 15 August 2023, 04:46:17 UTC
9039e6a chore: use 2x faster black mirror (#4784) Committed via https://github.com/asottile/all-repos 10 August 2023, 19:17:56 UTC
4bf60c6 Disable strip when build type is unset (#4454) (#4780) 08 August 2023, 03:58:30 UTC
690a115 Add `py::set_error()`, use in updated `py::exception<>` documentation (#4772) * Copy clang 17 compatibility fixes from PR #4762 to a separate PR. * static py::exception<> -> static py::handle * Add `py::set_error()` but also try the suggestion of @malfet (https://github.com/pytorch/pytorch/pull/106401#pullrequestreview-1559961407). * clang 17 compatibility fixes (#4767) * Copy clang 17 compatibility fixes from PR #4762 to a separate PR. * Add gcc:13 C++20 * Add silkeh/clang:16-bullseye C++20 * chore(deps): update pre-commit hooks (#4770) updates: - [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.276...v0.0.281) - [github.com/asottile/blacken-docs: 1.14.0 → 1.15.0](https://github.com/asottile/blacken-docs/compare/1.14.0...1.15.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) * docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools * Update docs/compiling.rst --------- Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> * Provide better type hints for a variety of generic types (#4259) * Provide better type hints for a variety of generic types * Makes better documentation * tuple, dict, list, set, function * Move to py::typing * style: pre-commit fixes * Update copyright line with correct year and actual author. The author information was copy-pasted from the git log output. --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Use `py::set_error()` everywhere possible (only one special case, in common.h). Overload `py::set_error(py::handle, py::handle)`. Change back to `static py::handle exc = ... .release();` Deprecate `py::exception<>::operator()` * Add `PYBIND11_WARNING_DISABLE` for INTEL and MSVC (and sort alphabetically). * `PYBIND11_WARNING_DISABLE_INTEL(10441)` does not work. For ICC only, falling back to the recommended `py::set_error()` to keep the testing simple. It is troublesome to add `--diag-disable=10441` specifically for test_exceptions.cpp, even that is non-ideal because it covers the entire file, not just the one line we need it for, and the value of exercising the trivial deprecated `operator()` on this one extra platform is practically zero. * Fix silly oversight. * NVHPC 23.5.0 generates deprecation warnings. They are currently not treated as errors, but falling back to using `py::set_error()` to not have to deal with that distraction. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Keto D. Zhang <keto.zhang@gmail.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> Co-authored-by: Dustin Spicuzza <dustin@virtualroadside.com> 08 August 2023, 03:48:20 UTC
824dc27 CI: Reenable an NVHPC Test (#4764) Update from CentOS to Ubuntu and to a recent version of NVHPC (former: PGI). Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 04 August 2023, 18:17:33 UTC
f870315 Provide better type hints for a variety of generic types (#4259) * Provide better type hints for a variety of generic types * Makes better documentation * tuple, dict, list, set, function * Move to py::typing * style: pre-commit fixes * Update copyright line with correct year and actual author. The author information was copy-pasted from the git log output. --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 04 August 2023, 05:48:57 UTC
9ad7e82 docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools (#4774) * docs: Remove upper bound on pybind11 in example pyproject.toml for setuptools * Update docs/compiling.rst --------- Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 04 August 2023, 05:14:23 UTC
413e632 chore(deps): update pre-commit hooks (#4770) updates: - [github.com/psf/black: 23.3.0 → 23.7.0](https://github.com/psf/black/compare/23.3.0...23.7.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.276...v0.0.281) - [github.com/asottile/blacken-docs: 1.14.0 → 1.15.0](https://github.com/asottile/blacken-docs/compare/1.14.0...1.15.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 04 August 2023, 05:11:25 UTC
17b6143 clang 17 compatibility fixes (#4767) * Copy clang 17 compatibility fixes from PR #4762 to a separate PR. * Add gcc:13 C++20 * Add silkeh/clang:16-bullseye C++20 03 August 2023, 20:36:29 UTC
f3e0602 Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. (#4757) * Add command to check for vX.Y.Z tag vs pybind11/_version.py consistency. Piggy-backing hints for converting changelog to release message. * Simpler way of double-checking version number in sources vs. git tag * Even simpler. * Fix rst rendering (hopefully) and remove stray dots. * [ci skip] Trying more to make GitHub rst renderer show this nicely. * [ci skip] Fix up RST rendering issues. Lesson learned: This is NOT GOOD: ``` - Bullet nesting level 1. - Bullet nesting level 2. ``` This is BETTER: ``` - Bullet nesting level 1. - Bullet nesting level 2. ``` Also consistently adding empty lines between bullet points, to make the .rst file easier to read. Also piggy-backing a few very minor enhancements. 23 July 2023, 18:10:10 UTC
8d08dc6 Copy v2.11.1 changelog section as released. (#4755) 17 July 2023, 19:07:42 UTC
99131a8 Provide `PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF` as an option (#4753) * Remove GIL checks * Update common.h * Add flag * style: pre-commit fixes * Update pytypes.h * style: pre-commit fixes * Update common.h * style: pre-commit fixes * Update pytypes.h * style: pre-commit fixes * Update common.h * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 17 July 2023, 07:05:52 UTC
ec1b57c Disable `PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF` generally for PyPy (not just PyPy Windows). (#4751) 15 July 2023, 19:55:00 UTC
0620d71 Update README.rst - Add missing comma in the list of acknowlegements (#4750) 15 July 2023, 16:58:54 UTC
e85696e Post release version bump (#4747) * Boilerplate version number update after v2.11.0 release. * Small updates to release.rst 14 July 2023, 21:53:58 UTC
1a917f1 docs: preparation for v2.11.0 release (#4744) * Remove .dev1 from version number. * Update Changelog (starting from `nox -s make_changelog` output) * Miscellaneous minor fixes from proofreading in GitHub web view. * docs: minor changelog updates Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com> 14 July 2023, 15:20:38 UTC
b33d06f bugfix: fixes a test suite bug in the __new__ example (#4698) * bugfix: fixes a test suite bug in the __new__ example * See https://github.com/pybind/pybind11/pull/4698#discussion_r1227107682 --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 12 July 2023, 20:20:08 UTC
2e5f5c4 fix: support CMake 3.27, drop 3.4 (#4719) * fix: support CMake 3.27, drop 3.4 Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Update upgrade.rst * Update upgrade.rst * Update upgrade.rst --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> 12 July 2023, 18:10:24 UTC
6d22dba Warning on comparing wrapper enums with is (#4732) * Warning on comparing wrapper enums with is * backticks for quoting and link to related issue --------- Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com> 12 July 2023, 15:56:40 UTC
b2732c6 chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 (#4718) * chore(deps): bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.7 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.6 to 1.8.7. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.6...v1.8.7) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Apply suggestions from code review --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 12 July 2023, 15:55:18 UTC
47dc0c4 chore(deps): update pre-commit hooks (#4727) updates: - [github.com/pre-commit/mirrors-clang-format: v16.0.4 → v16.0.6](https://github.com/pre-commit/mirrors-clang-format/compare/v16.0.4...v16.0.6) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.270 → v0.0.276](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.270...v0.0.276) - [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.3.0...v1.4.1) - [github.com/asottile/blacken-docs: 1.13.0 → 1.14.0](https://github.com/asottile/blacken-docs/compare/1.13.0...1.14.0) - [github.com/codespell-project/codespell: v2.2.4 → v2.2.5](https://github.com/codespell-project/codespell/compare/v2.2.4...v2.2.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> 11 July 2023, 17:31:43 UTC
back to top