pybind11/include/pybind11
Ralf W. Grosse-Kunstleve 690a115d84
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>
2023-08-07 20:48:20 -07:00
..
detail Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
eigen Add format_descriptor<> & npy_format_descriptor<> PyObject * specializations. (#4674) 2023-05-23 10:49:32 -07:00
stl feature: support compilers that use std::experimental::filesystem (#3840) 2022-03-31 22:16:10 -07:00
attr.h Elide to-python conversion of setter return values (#4621) 2023-05-08 10:13:54 -07:00
buffer_info.h Add format_descriptor<> & npy_format_descriptor<> PyObject * specializations. (#4674) 2023-05-23 10:49:32 -07:00
cast.h clang 17 compatibility fixes (#4767) 2023-08-03 13:36:29 -07:00
chrono.h chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
common.h Add a dummy common.h header with a deprecation warning 2017-09-06 15:22:26 +02:00
complex.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
eigen.h First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
embed.h Introduce get_python_state_dict() for Python 3.12 compatibility. (#4570) 2023-03-27 17:52:57 -07:00
eval.h fix: missing move in eval.h (#3775) 2022-03-02 15:25:43 -05:00
functional.h Fix functional.h bug + introduce test to verify that it is fixed (#4254) 2022-11-02 11:32:53 -07:00
gil.h bugfix: delete proper ctors in gil.h (#4490) 2023-02-04 13:40:13 -05:00
iostream.h chore: add err guard to capsule destructor and add a move to iostream (#3958) 2022-05-27 14:32:57 -04:00
numpy.h Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
operators.h Reproducer and fix for issue encountered in smart_holder update. (#4228) 2022-10-09 21:50:35 -07:00
options.h Add option for enable/disable enum members in docstring. (#2768) 2022-12-08 23:10:10 -08:00
pybind11.h Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
pytypes.h Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
stl_bind.h Introduce recursive_container_traits (#4623) 2023-05-04 22:39:05 -07:00
stl.h Use annotated for array (#4679) 2023-05-24 21:39:36 -07:00
type_caster_pyobject_ptr.h Add type_caster<PyObject> (#4601) 2023-05-07 10:15:53 -07:00
typing.h Provide better type hints for a variety of generic types (#4259) 2023-08-03 22:48:57 -07:00