Public
  1. Public

pybind11

Public
AuthorCommitMessageCommit dateIssues
Michał GórnyGitHubMichał Górny
d8565ac7317Sync `Py_TPFLAGS_MANAGED_DICT` for PyPy3.11 across the codebase (#5537)* Sync `Py_TPFLAGS_MANAGED_DICT` for PyPy3.11 across the codebase Adjust the `Py_TPFLAGS_MANAGED_DICT` logic in `include/pybind11/attr.h` to match the one used in `include/pybind11/detail/class.h`. This is a followup to #5508. * Use a common `#define` for pre-`Py_TPFLAGS_MANAGED_DICT` Pythons * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bo...
Matti PicusGitHubMatti Picus
09b9f44ab7aadd recently released pypy3.11 (#5534)
gentlegiantJGCGitHubgentlegiantJGC
73825f351b8Improved reference_internal documentation (#5528)* Improved reference_internal documentation Improved the wording to make it easier to understand and added a note about the policy falling back to move if the return value is not an lvalue reference or pointer. * Added bold and ticket number
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
b7c33009ac5Start pybind11v3: Remove all code for `PYBIND11_INTERNALS_VERSION`s `4` and `5` (#5530)* Start pybind11v3 * Remove all code for PYBIND11_INTERNALS_VERSION 4 and 5 * Fix oversight: pybind11/_version.py needs to be updated as well. * Add @pytest.mark.skipif("env.GRAALPY", reason="TODO debug segfault")
Michael CarlstromGitHubMichael Carlstrom
241524223a2feat(types) Numpy.typing.NDArray (#5212)* tests passing * lint * add comment * remove empty tuple[()] * test io_name * style: pre-commit fixes * remove accidental > Signed-off-by: Michael Carlstrom <rmc@carlstrom.com> * try T * make both const_name Signed-off-by: Michael Carlstrom <rmc@carlstrom.com> * try and treat as string * style: pre-commit fixes * Update Numpy type hints * style: pre-commit fixes * re-run ci Sig...
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
34a118fd36eAdd `release_gil_before_calling_cpp_dtor` annotation for `class_` (#5522)* Backport of https://github.com/google/pybind11clif/pull/30088 (main PR) and https://github.com/google/pybind11clif/pull/30092 (minor fixes). Note for completeness: These are identical to the current versions on the pybind11clif main branch (@ commit 4841661df5daf26ecdedaace54e64d0782e63f64): * test_class_release_gil_before_calling_cpp_dtor.cpp * test_class_release_gil_before_calling_cpp_dt...
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
c316cf36204Make PYBIND11_INTERNALS_VERSION 6 the default on all platforms.(#5512)
daizhiruiGitHubdaizhirui
31d7c870cfbRemove some maybe-uninitialized warnings (#5516)* Remove some maybe-uninitialized warnings In the Eigen matrix type_caster, resize the matrix instead of assigning with a new one when the matrix size needs to be adjusted. This can remove lots of compiling warnings about "maybe-uninitialized". * Revert "Remove some maybe-uninitialized warnings" This reverts commit 7d5a9b41aaf6878f9ff27aa0fb68c6de4a409a01. * Suppress `-Wmaybe-uninitialized...
pre-commit-ci[bot]GitHubpre-commit-ci[bot]
d2e7e8c6871chore(deps): update pre-commit hooks (#5513)* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v19.1.6 → v19.1.7](https://github.com/pre-commit/mirrors-clang-format/compare/v19.1.6...v19.1.7) - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.4) - [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](https://github.c...
Michael ŠimáčekGitHubMichael Šimáček
ab44b307b27Skip transient crash on GraalPy on OS X (#5514)
dependabot[bot]GitHubdependabot[bot]
8862cd4e7d4chore(deps): bump seanmiddleditch/gha-setup-ninja in the actions group (#5509)Bumps the actions group with 1 update: [seanmiddleditch/gha-setup-ninja](https://github.com/seanmiddleditch/gha-setup-ninja). Updates `seanmiddleditch/gha-setup-ninja` from 5 to 6 - [Release notes](https://github.com/seanmiddleditch/gha-setup-ninja/releases) - [Commits](https://github.com/seanmiddleditch/gha-setup-ninja/compare/v5...v6) --- updated-dependencies: - dependency-name: seanmiddle...
Matti PicusGitHubMatti Picus
fe87568f0b0PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT (#5508)* PyPy 3.11 does not implement Py_TPFLAGS_MANAGED_DICT * add a comment (from review) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
dependabot[bot]GitHubdependabot[bot]
82845c3b48echore(deps): bump actions/attest-build-provenance in the actions group (#5503)Bumps the actions group with 1 update: [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance). Updates `actions/attest-build-provenance` from 2.1.0 to 2.2.0 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/at...
Xuehai PanGitHubXuehai Pan
924261e814echore(cmake): Add an author warning that auto-calculated `PYTHON_MODULE_EXTENSION` may not respect `SETUPTOOLS_EXT_SUFFIX` during cross-compilation (#5495)
Nikul PatelGitHubNikul Patel
c19c291b98afeat: --extension-suffix for pybind11 command (#5360)* fix docs build command on different global and venv python versions * feat: add --extension-suffix Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: Nikul Patel <nikul@z830> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Jochen SprickerhofGitHubJochen Sprickerhof
167bb5f271bfix(cmake): don't strip with BUILD_TYPE None (#5392)Debian builds with None by default and takes care of stripping itself. This allows building debug symbol packages.
Tim OhligerGitHubTim Ohliger
1b7aa0bb668feat: rework of arg/return type hints to support .noconvert() (#5486)* Added rework of arg/return typing * Changed `Path` to `pathlib.Path` for compatibility with pybind11-stubgen * Removed old arg/return type hint implementation * Added noconvert support for arg/return type hints * Added commented failing tests for Literals with special characters * Added return_descr/arg_descr for correct typing in typing::Callable * Fixed clang-tidy issues * Changed io...
Sam GrossGitHubSam Gross
15d9dae14b1Fix data race when using shared variables (free threading) (#5494)* Fix data race when using shared variables (free threading) In the free threading build, there's a race between wrapper re-use and wrapper deallocation. This can happen with a static variable accessed by multiple threads. Fixing this requires using some private CPython APIs: _Py_TryIncref and _PyObject_SetMaybeWeakref. The implementations of these functions are included until they're made av...
dependabot[bot]GitHubdependabot[bot]
945e251a6cechore(deps): bump jinja2 from 3.1.4 to 3.1.5 in /docs (#5490)Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.4...3.1.5) --- updated-dependencies: - dependency-name: jinja2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@gi...
pre-commit-ci[bot]GitHubpre-commit-ci[bot]
a09cf61844fchore(deps): update pre-commit hooks (#5488)updates: - [github.com/pre-commit/mirrors-clang-format: v19.1.4 → v19.1.6](https://github.com/pre-commit/mirrors-clang-format/compare/v19.1.4...v19.1.6) - [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.1...v0.8.6) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...
gentlegiantJGCGitHubgentlegiantJGC
c5ed9d4b193Fix module type hint (#5469)* Fix module type hint "module" is not a valid python value. The correct type hint for a module object is "types.ModuleType" which has existed since at least Python 2.6 * Added module type hint test * style: pre-commit fixes * Remove doc function * Fixed type hint --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Michael CarlstromGitHubMichael Carlstrom
cf020a1de25feat(types) Allow setting types for attributes (#5460)* init * add comment * style: pre-commit fixes * fix extra ; * Add annotation helper for older python versions * style: pre-commit fixes * test writing __annotations__ to __dict__ * style: pre-commit fixes * revert bac to __annotations__ * use getattr for automatic init * use std::move * update helper * remove stdmove * test isinstance * style: pre-commit fixes * add #if 3.9 * s...
dependabot[bot]GitHubdependabot[bot]
5b503f7ec97chore(deps): bump actions/attest-build-provenance in the actions group (#5468)Bumps the actions group with 1 update: [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance). Updates `actions/attest-build-provenance` from 2.0.1 to 2.1.0 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/at...
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
3e419485c3b`PYBIND11_PLATFORM_ABI_ID` Modernization Continued (platforms other than MSVC) (#5439)* THIS IS JUST A START: First attempt to combine information from PR #4953 and PR #5437 * Include GXX_ABI and USE_CXX in the identifier Further constrain to GXX_ABI 1002 or greater and less than 2000, hopefully future proof by summarizing that as `1` along with CXX11 on or off. * style: pre-commit fixes * Use `gxx_abi_1xxx` and simplify the Clang string After discussions with Ralf Grosse-K...
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
741d86f2e35Drop Clang dev CI job (#5464)* Drop clang dev job for now.
dependabot[bot]GitHubdependabot[bot]
3ebdc503d29chore(deps): bump actions/attest-build-provenance in the actions group (#5461)Bumps the actions group with 1 update: [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance). Updates `actions/attest-build-provenance` from 1.4.4 to 2.0.1 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/at...
pre-commit-ci[bot]GitHubpre-commit-ci[bot]
b17555f3403chore(deps): update pre-commit hooks (#5459)* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v19.1.3 → v19.1.4](https://github.com/pre-commit/mirrors-clang-format/compare/v19.1.3...v19.1.4) - [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.7.2...v0.8.1) - [github.com/sirosen/texthooks: 0.6.7 → 0.6.8](https://github.com/sirosen/t...
Tim OhligerGitHubTim Ohliger
1d09fc8300dOption for arg/return type hints and correct typing for std::filesystem::path (#5450)* Added arg/return type handling. * Added support for nested arg/return type in py::typing::List * Added support for arg/return type in stl/filesystem * Added tests for arg/return type in stl/filesystem and py::typing::List * Added arg/return name to more py::typing classes * Added arg/return type to Callable[...] * Added tests for typing container classes (also nested) * Changed typing ...
James MorrisGitHubJames Morris
a6d1ff2460afix: make PYBIND11_WARNING_POP actually pop clang diagnostics (#5448)* fix: make PYBIND11_WARNING_POP actually pop clang diagnostics * fix: ignore -Wgnu-zero-variadic-macro-arguments on clang * Revert "fix: ignore -Wgnu-zero-variadic-macro-arguments on clang" This reverts commit d310959bf5e6194033aa1825ab181a76289d790f. * C++20 modernization: Use `__VA_OPT__(, ) __VA_ARGS__` in `PYBIND11_DECLARE_HOLDER_TYPE()` * Disable `__VA_OPT__(, ) __VA_ARGS__` usage fo...
dependabot[bot]GitHubdependabot[bot]
e7c9b907394chore(deps): bump pypa/cibuildwheel in the actions group (#5451)Bumps the actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel). Updates `pypa/cibuildwheel` from 2.21 to 2.22 - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.21...v2.22) --- updated-dependencies: - depen...
Michael ŠimáčekGitHubMichael Šimáček
83b92ceb353Try to fix reentrant write transient failures in tests (#5447)* Disable print_destroyed in tests on GraalPy * Reenable test_iostream on GraalPy
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
330aae51cfdRemove mingw-w64-i686-python-numpy from mingw32 build (it does not seem to exist anymore). (#5445)Last successful: Sat, 16 Nov 2024 18:25:21 GMT First failure: Sat, 16 Nov 2024 21:43:28 GMT ``` Installing additional packages through pacman... C:\Windows\system32\cmd.exe /D /S /C D:\a\_temp\setup-msys2\msys2.cmd -c "'pacman' '--noconfirm' '-S' '--needed' '--overwrite' '*' 'git' 'mingw-w64-i686-gcc' 'mingw-w64-i686-python-pip' 'mingw-w64-i686-python-numpy' 'mingw-w64-i686-cmake' 'mingw-w6...
Maarten BaertGitHubMaarten Baert
f41dae31a3eAdd dtype::normalized_num and dtype::num_of (#5429)* Add dtype::normalized_num and dtype::num_of * Fix compiler warning and improve NumPy 1.x compatibility * Fix clang-tidy warning * Fix another clang-tidy warning * Add extra comment
Maarten BaertGitHubMaarten Baert
b9fb3168ab2Add support for array_t<handle> and array_t<object> (#5427)* Add support for array_t<handle> and array_t<object> * style: pre-commit fixes * Remove loops that aren't strictly needed * Fix compiler warning * Disable GC-dependent checks when running on pypy or graalpy * style: pre-commit fixes * Remove PyValueHolder counter again * Move tests to templates to avoid code duplication * Rerun pre-commit * Restore import that was erroneously removed ...
Michael ŠimáčekGitHubMichael Šimáček
08095d9c702Run pytest in verbose mode (#5443)
dependabot[bot]GitHubdependabot[bot]
0ed20f26acechore(deps): bump actions/attest-build-provenance in the actions group (#5440)Bumps the actions group with 1 update: [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance). Updates `actions/attest-build-provenance` from 1.4.3 to 1.4.4 - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/at...
Xuehai PanGitHubXuehai Pan
7f94f24d646feat(typing): allow annotate methods with `pos_only` when only have the `self` argument (#5403)* feat: allow annotate methods with `pos_only` when only have the `self` argument * chore(typing): make arguments for auto-generated dunder methods positional-only * docs: add more comments to improve readability * style: fix nit suggestions * Add test_self_only_pos_only() in tests/test_methods_and_attributes * test: add docstring tests for generated dunder methods * test: remove failed t...
gentlegiantJGCGitHubgentlegiantJGC
6d98d4d8d46Add type hints for args and kwargs (#5357)* Allow subclasses of args and kwargs The current implementation disallows subclasses of args and kwargs * Added object type hint to args and kwargs * Added type hinted args and kwargs classes * Changed default type hint to typing.Any * Removed args and kwargs type hint * Updated tests Modified the tests from #5381 to use the real Args and KWArgs classes * Added comment
Ralf W. Grosse-KunstleveGitHubRalf W. Grosse-Kunstleve
a90e2af88d8Factor out pybind11/conduit/pybind11_platform_abi_id.h (#5375)* Factor out pybind11/compat/wrap_include_python_h.h * Fixes to resolve tests_packaging failures. * Factor out pybind11/compat/pybind11_platform_abi_id.h * Add pybind11/compat/README.txt and a couple source code comments. * Minor changes to comments. * Factor out pybind11/compat/pybind11_conduit_v1.h * Add long comment to pybind11/compat/pybind11_conduit_v1.h * Add pybind11/compat/README...
Isuru FernandoGitHubIsuru Fernando
ec9c26817f8Fix MSVC MT/MD incompatibility in PYBIND11_BUILD_ABI (#4953)* Fix MSVC MT/MD incompatibility in PYBIND11_BUILD_ABI * Update comment about which PR * Use msvc major version * Use _MSC_VER/100 * Fix figuring out MD vs MT * Add some test runs * Skip one test * Fix preprocessor * simplify code * fix if * support only msvc 19 * Fold in changes from experimental PR #5411. Polish error messages. * Remove `&& defined(_DLL)` (TBD: is it needed? but w...
Elliott Sales de AndradeGitHubElliott Sales de Andrade
037310ea8a3Use std::unique_ptr in pybind11_getbuffer (#5435)* Use std::unique_ptr in pybind11_getbuffer * Move final assignment later
vfdevGitHubvfdev
ce2f0055949Fixed data race in all_type_info in free-threading mode (#5419)* Fix data race all_type_info_populate in free-threading mode Description: - fixed data race all_type_info_populate in free-threading mode - added test For example, we have 2 threads entering `all_type_info`. Both enter `all_type_info_get_cache`` function and there is a first one which inserts a tuple (type, empty_vector) to the map and second is waiting. Inserting thread gets the (iter_to_key...
Tim StumbaughGitHubTim Stumbaugh
f46f5be4fa4Fix incorrect link syntax in upgrade guide (#5434)Looks like some markdown spilled into our restructured text
pre-commit-ci[bot]GitHubpre-commit-ci[bot]
5c07feef2f9chore(deps): update pre-commit hooks (#5432)* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.3](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.8...v19.1.3) - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.7.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.7.2) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](https://github.com...
Elliott Sales de AndradeGitHubElliott Sales de Andrade
bc041de0db1Fix buffer protocol implementation (#5407)* Fix buffer protocol implementation According to the buffer protocol, `ndim` is a _required_ field [1], and should always be set correctly. Additionally, `shape` should be set if flags includes `PyBUF_ND` or higher [2]. The current implementation only set those fields if flags was `PyBUF_STRIDES`. [1] https://docs.python.org/3/c-api/buffer.html#request-independent-fields [2] https://docs.pyt...
Michael ŠimáčekGitHubMichael Šimáček
75e48c5f959Skip transient tests on GraalPy (#5422)
Francesco BallarinGitHubFrancesco Ballarin
f7e14e985beAddress regression introduced in #5381 (#5396)* Incomplete attempt to address regression introduced in #5381 * style: pre-commit fixes * Revert "style: pre-commit fixes" This reverts commit 9d107d2f751d76b2c26e90cd08d2ac163022c873. * Revert "Incomplete attempt to address regression introduced in #5381" This reverts commit 8cf1cdbc96ac326ff6d64a36ea291472f74c016f. * Simpler fix for the regression introduced in #5381 * style: pre-comm...
cyyeverGitHubcyyever
077e49fcd6dExport libc++ exceptions (#5390)* Export libc++ exceptions * Remove emscripten limit * Remove __apple_build_version__ condition from PYBIND11_EXPORT_EXCEPTION * Add a comment
Boris DalsteinGitHubBoris Dalstein
f2907651fadFix #5399: iterator increment operator does not skip first item (#5400)* Fix #5399: iterator increment operator does not skip first item * Fix postfix increment operator: init() must be called before copying *this
Thomas KöppeGitHubThomas Köppe
af67e87393bdocs/advanced A document about deadlock potential with C++ statics (#5394)* [docs/advanced] A document about deadlock potential with C++ statics * [docs/advanced] Refer to deadlock.md from misc.rst * [docs/advanced] Fix tables in deadlock.md * Use :ref:`deadlock-reference-label` * Revert "Use :ref:`deadlock-reference-label`" This reverts commit e5734d275fa0d38ad4a58a595797353813e65df1. * Add simple references to docs/advanced/deadlock.md filename. (Maybe someon...