Commit Graph

3089 Commits

Author SHA1 Message Date
Henry Schreiner
513d1f962e ci: check iOS update (#5717) 2025-06-10 17:36:09 -04:00
dependabot[bot]
ff0e381d9e chore(deps): bump requests from 2.32.3 to 2.32.4 in /docs (#5720)
Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.4)

---
updated-dependencies:
- dependency-name: requests
  dependency-version: 2.32.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 17:35:50 -04:00
Xuehai Pan
6c5d25aae2 test: run pytest under Python devmode (#5715)
* test: run pytest under Python devmode

* test: skip segfault bug with 3.14.0b1/2

* test: skip segfault bug with 3.14.0b1/2

* test: unset CMAKE_BUILD_PARALLEL_LEVEL
2025-06-06 03:54:02 -04:00
Henry Schreiner
5d32ed76c0 docs: prepare for RC 3 (#5713)
* docs: prepare for RC 3

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: one more rc 3 update

* chore: bump to 3.0.0rc3

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
v3.0.0rc3
2025-06-05 11:14:33 -04:00
Xuehai Pan
c786d34f60 fix: handle null py::handle and add tests for py::scoped_critical_section (#5706)
* chore: handle null for `py::scoped_critical_section`

* test: add tests for `py::scoped_critical_section`

* test: use assert instead of REQUIRE

* feat: enable faulthandler for pytest

* chore: use `__has_include(<barrier>)`

* fix: fix segmentation fault in test

* fix: test critical_section for no-gil only

* test: run new tests only

* test: ensure non-empty test selection

* fix: fix test critical_section

* fix: change Python 3.14.0b1/2 xfail tests to non-strict

* test: trigger gc manually

* test: mark xfail to `DynamicClass`

* Use `namespace test_scoped_critical_section_ns` (standard approach to guard against name clashes).

* Simplify changes in pybind11/critical_section.h and add test_nullptr_combinations()

* test: disable Python devmode in pytest

* test: add comprehensive comments for the tests

* test: add a summary comment for tests

* refactor: simpler impl

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-06-04 11:45:26 -04:00
b-pass
c7026d0d1c fix!: modify the internals pointer-to-pointer implementation to not use thread_local (#5709)
* Refactor internals to use a holder that manages the PP

* Refactor internals to use a holder that manages the PP

* Fix cleanup/destruction issues.

* Fix one more destruction issue

Should now just be able to delete the internals PP on destruction

* Make clang-tidy happy

* Try to fix exception translators issue on certain platforms

Also fix a couple more pedantic warings

* Fix test, after internals is free'd it can come back at the same address

So instead, just make sure it was zero'd and don't try to compare the addresses.

Also a little code cleanup

* Comment tweak [skip ci]

* Switch to ifdef instead of if

* Re-enable subinterpreters in iOS

* style: pre-commit fixes

* Oops, this snuck in on merge

* fix: bump ABI version to 10

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>
2025-06-03 16:02:44 -04:00
Peter Steneteg
b19489145b fix: expose required symbol using clang (#5700)
* test: Added test case for visibility of common symbols across shared libraries

* style: pre-commit fixes

* tests: cmake target name fix

* tests: Added visibility test to ci

* tests: set the default visibility to hidden

* prototype/proof-of-concept fix: PYBIND11_EXPORT_GUARDED_DELETE

* Fix silly oversight: actually use PYBIND11_EXPORT_GUARDED_DELETE

* Update struct_smart_holder.h

* style: pre-commit fixes

* Update include/pybind11/detail/struct_smart_holder.h

* Update struct_smart_holder.h

* ci: fix addition to reusable-standard.yml

* Update CMakeLists.txt

* refactor: rename tests to test_cross_module_rtti

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>
Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
2025-06-03 16:02:19 -04:00
Henry Schreiner
d4d2ec1ad8 ci: avoid brownout (and removal) of windows-2019 (#5712)
* ci: avoid brownout (and removal) of windows-2019

* Drop 2019 or update to 2022/latest
2025-06-03 13:06:20 -04:00
pre-commit-ci[bot]
0985052ad6 chore(deps): update pre-commit hooks (#5711)
updates:
- [github.com/pre-commit/mirrors-clang-format: v20.1.3 → v20.1.5](https://github.com/pre-commit/mirrors-clang-format/compare/v20.1.3...v20.1.5)
- [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.8...v0.11.12)
- [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.16.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.16.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-02 18:08:40 -04:00
Henry Schreiner
9295c4a568 fix: follow rest of pybind11 closer with PYBIND11_HAS_SUBINTERPRETER_SUPPORT (#5710)
* fix: follow rest of pybind11 closer with PYBIND11_HAS_SUBINTERPRETER_SUPPORT

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-02 16:08:40 -04:00
Henry Schreiner
7da1d53df5 ci: test on iOS (#5705)
* ci: add iOS

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update .github/workflows/tests-cibw.yml

* ci: use test groups

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-06-02 00:29:40 -04:00
Michael Carlstrom
c2b32b1e3b fix(types): type hints from future python versions (#5693)
* fix future type hints

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* style: pre-commit fixes

* remove unused var

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* remove union_helper

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* fix speelling error

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* base case for union_concat

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* style: pre-commit fixes

* add case for one descr

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* weakref and final test

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* Add acrpss_version_type_hint_checker

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* cleanup

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* style: pre-commit fixes

* remove test.pyi

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* use new unions and add fixture

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* timohl suggested cleanup

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* style: pre-commit fixes

* add missing auto

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>

* style: pre-commit fixes

* move operator| def

---------

Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-31 23:47:20 -04:00
Henry Schreiner
21c9dd11bc ci: drop main tests on main
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-31 15:44:42 -04:00
Henry Schreiner
e4873e8f59 fix: allow subinterp support to be disabled
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-31 15:44:42 -04:00
Henry Schreiner
33fb53335e fix: C++20 in Windows
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

style: pre-commit fixes
2025-05-30 18:30:25 -04:00
Henry Schreiner
bc557a9b5b tests: add PYBIND11_TEST_SMART_HOLDER to tests
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-30 18:30:25 -04:00
Henry Schreiner
29979761ba ci: rename cibw workflow file
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-30 18:30:25 -04:00
Henry Schreiner
7e672ca106 tests: support C++23 in tests
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-30 18:30:25 -04:00
Henry Schreiner
ef2ad42d2d ci: list all jobs explicitly
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-30 18:30:25 -04:00
Henry Schreiner
5dff3354fc ci: reduce runs on draft PRs
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Update ci.yml
2025-05-30 18:30:25 -04:00
Henry Schreiner
df595b1657 docs: changelog update for 3.0.0rc2
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
v3.0.0rc2
2025-05-29 11:05:00 -04:00
Henry Schreiner
a1b1972241 chore: prepare for 3.0.0rc2 (#5698)
* chore: prepare for 3.0.0rc2

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update docs/changelog.md

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-29 01:16:32 -04:00
Henry Schreiner
a18b1bc4dc tests: always disable on the nogil build (#5701)
* docs: fix docs on visibilty preset hidden

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: always disable on the nogil build

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

* docs: mention skip reason in comment

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>
2025-05-28 23:33:53 -04:00
Henry Schreiner
57e27c1ffc tests: skip some flaky gil tests on nogil (#5699)
* tests: skip some flaky gil tests on nogil

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update test_gil_scoped.py

* style: pre-commit fixes

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-27 11:22:35 -04:00
Henry Schreiner
1c10d5e9b1 fix: prepare for 3.14 beta 2 (#5697)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-27 00:05:19 -04:00
Henry Schreiner
6e3e8515e7 fix(cmake): regression in include gaurd (#5691)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-26 12:26:08 -04:00
b-pass
03b4a9e56f fix: don't destruct module objects in atexit (#5688) 2025-05-25 18:56:26 -04:00
Henry Schreiner
1dd85ef42a chore: bump maximum clang tested to 20 (#5692) 2025-05-25 10:54:05 -04:00
Henry Schreiner
9d06626521 docs: more warnings about locking and the GIL (#5689)
* docs: more warnings about locking and the GIL

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix require → reacquire typo

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
2025-05-24 19:12:49 -04:00
Henry Schreiner
d7769de533 feat: scoped_critical_section (#5684)
* feat: scoped_critical_section

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* refactor: pull out to file

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

* fix: GIL code in some compilers

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: move to correct spot

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>
2025-05-23 17:41:45 -04:00
Xuehai Pan
e3883dd5d5 refactor: use CPython macros to construct PYBIND11_VERSION_HEX (#5683)
* refactor: use CPython macros to construct `PYBIND11_VERSION_HEX`

* docs: update release guide

* tests: add test to keep version values in sync

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

* test: update version test

* test: update version test

* test: update version test

* chore: update code comments

* Update docs/release.rst

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-23 17:12:46 -04:00
Henry Schreiner
e4622cbd7b chore(cmake): add compile commands to preset (#5685)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-23 15:13:37 -04:00
Xuehai Pan
98bd78f063 chore: rename macro PYBIND11_SUBINTERPRETER_SUPPORT -> PYBIND11_HAS_SUBINTERPRETER_SUPPORT to meet naming convention (#5682) 2025-05-22 10:16:57 -07:00
Henry Schreiner
8d503e30be docs: update contributing/release guide a little (#5681)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-22 01:38:10 -04:00
Henry Schreiner
2624d4a360 tests: expect free-threaded import warnings (#5680)
* tests: expect free-threaded import warnings

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update tests/test_cpp_conduit.py

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>

* Update tests/test_cpp_conduit.py

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
2025-05-22 01:37:57 -04:00
Henry Schreiner
fc888f758f docs: prepare for 3.0.0rc1 (#5679)
* docs: prepare for 3.0.0rc1

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update changelog.md

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
v3.0.0rc1
2025-05-21 14:14:27 -04:00
Henry Schreiner
e8f16e2fdd docs: remove setup.py mentions, mention presets (#5677)
* docs: remove setup.py mentions, mention presets

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update .github/CONTRIBUTING.md

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-20 19:02:41 -04:00
b-pass
07d028f218 feat: Embeded sub-interpreters (#5666)
* First draft a subinterpreter embedding API

* Move subinterpreter tests to their own file

* Migrate subinterpreter tests to use the new embedded class.

* Add a test for moving subinterpreters across threads for destruction

And find a better way to make that work.

* Code organization

* Add a test which shows demostrates how gil_scoped interacts with sub-interpreters

* Add documentation for embeded sub-interpreters

* Some additional docs work

* Add some convenience accessors

* Add some docs cross references

* Sync some things that were split out into #5665

* Update subinterpreter docs example to not use the CPython api

* Fix pip test

* style: pre-commit fixes

* Fix MSVC warnings

I am surprised other compilers allowed this code with a deleted move ctor.

* Add some sub-headings to the docs

* Oops, make_unique is C++14 so remove it from the tests.

* I think this fixes the EndInterpreter issues on all versions.

It just has to be ifdef'd because it is slightly broken on 3.12, working well on 3.13, and kind of crashy on 3.14beta.  These two verion ifdefs solve all the issues.

* Add a note about exceptions.

They contain Python object references and acquire the GIL, that means they are a danger with subinterpreters!

* style: pre-commit fixes

* Add try/catch to docs examples to match the tips

* Python 3.12 is very picky about this first PyThreadState

Try special casing the destruction on the same thread.

* style: pre-commit fixes

* Missed a rename in a ifdef block

* I think this test is causing problems in 3.12, so try ifdefing it to see if the problems go away.

* style: pre-commit fixes

* Document the 3.12 constraints with a warning

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* ci: add cpptest to the clang-tidy job

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* noexcept move operations

* Update include/pybind11/subinterpreter.h

std::memset

Co-authored-by: Aaron Gokaslan <aaronGokaslan@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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
2025-05-20 18:17:48 -04:00
Henry Schreiner
ec8b050824 chore: convert changelog to markdown (#5672)
* chore: move changelog to markdown

* chore: switch to simpler block def

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

* chore: handle more block ends

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: fix md display

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: one more fix

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-20 14:52:14 -04:00
Henry Schreiner
e625668439 fix(cmake): error wasn't triggering (#5676)
* fix(cmake): error wasn't triggering

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): wrong name of option

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-20 12:30:40 -04:00
Henry Schreiner
7319402a9f chore: show preview on docs changes (#5673)
* chore: show preview on docs changes

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update .github/workflows/docs-link.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-20 10:44:55 -04:00
Henry Schreiner
3867c5f5a8 ci: add nightlies for scientific-python (#5675)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-20 10:42:14 -04:00
b-pass
9e6fe464be chore: consolidate common code in PYBIND11_MODULE and PYBIND11_EMBEDDED_MODULE (#5670)
* Move common code from PYBIND11_MODULE and PYBIND11_EMBEDDED_MODULE into one macro

The difference between the two is really small, almost all of the code was the same.

* Use a macro to make the forward decl correct and reduce code duplication

* Oops, extra semicolon

* Split up the macro into two so we can avoid the redundant decl
2025-05-19 20:34:26 -04:00
gentlegiantJGC
67424358f4 fix(types): add typing and collections.abc module prefix (#5663)
* Fix Python 3.8 type hints and add module prefix

These type hints are invalid in Python 3.8.
Add `typing.` prefix to remove ambiguity.

* style: pre-commit fixes

* Add module prefix to Union

* Rename macros

* Improve comment

* Comment out 3.8 type hint macros

Fixing this issue in Python 3.8 will require updating lots of tests. This can be added in a further pull request.

* Add Iterable module prefix

* Add module prefix to Iterator

* Add module prefix to Callable

* Re-add accidentally deleted brackets

* Add module prefix to Optional

* Add module prefix to Final

* Add module prefix to ClassVar

* Add module prefix to TypeGuard

* Add module prefix to TypeIs

* Add module prefix to NoReturn

* Add module prefix to Never

* Add module prefix to Literal

* Add module prefix to Callable

* Add module prefix to Sequence

* Add module prefix to Iterator

* style: pre-commit fixes

* Remove type hint macros

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-19 11:54:31 -04:00
Ralf W. Grosse-Kunstleve
4587d33cf9 docs: prepare for v3.0.0rc1 (#5589)
* Squashed prepv300/manuscript — 30b9c268aeb98308ea42aaccfd5fe454e173c6fc — 2025-03-30 14:56:03 -0700 [skip ci]

[Browse prepv300/manuscript tree](30b9c268ae)

[Browse prepv300/manuscript commits](30b9c268ae/)

* docs: update changelog

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: upgrade guide CMake suggestions

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Explain type_caster_enum_type_enabled, copyable_holder_caster_shared_ptr_with_smart_holder_support_enabled, move_only_holder_caster_unique_ptr_with_smart_holder_support_enabled in Upgrade guide.

* Add a small section for py::bind_vector, py::bind_map & py::smart_holder

* Fix tiny oversight: Reference back to the current release v2.13 (not v2.12)

* Remove sentence: Using self._pybind11_conduit_v1_() ... should keep extension compatibility.

This isn't true, because we also modernized `PYBIND11_PLATFORM_ABI_ID`
(which I believe was absolutely necessary). I think it'll be too complicated
to explain that here, and there is a mention in the Upgrade guide.

* Changelog: combine #4953 and #5439

* Trivial whitespace/formatting fixes/enhancements.

* chore: add more to deprecation page

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: update for recent additions

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: fixes and set rc1 version

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: support rc versions

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Undo erroneous copilot change: We need to use `detail::enable_if_t`, for compatibility with C++11 and C++14.

* Empty lines cleanup.

* Rewording of "CMake support now defaults to ..." paragraph.

* Add missing backticks in upgrade guide.

* Try :ref:deprecated instead of :doc:deprecated

* docs: last bit of polish

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Piggy-back trivial whitespace cleanup that was missed in PR #5669

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-19 09:02:11 -04:00
Henry Schreiner
cc86e8b2a6 fix(cmake): better --fresh support (#5668)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-05-18 21:12:12 -04:00
Xuehai Pan
6bf25d1e39 feat: add semi-public API: pybind11::detail::is_holder_constructed (#5669)
* Add semi-public API: `pybind11::detail::is_holder_constructed`

* Update docs for `pybind11::custom_type_setup`

* Update tests in `test_custom_type_setup.cpp`

* Apply suggestions from code review
2025-05-18 21:11:56 -04:00
b-pass
9afc9c4ffb feat: change PYBIND11_EMBEDDED_MODULE to multiphase init (#5665)
* Move embedded modules to multiphase init

So that they too can support multi-interpreter and nogil tags

* Update the multiple interpreter test for embedded module changes

* Add a note to embedded module docs about the new tags

* Oops, missed a warning pop

* Remove unused variable

* Update ci.yml

* Fix this embedded GIL test for free-threading

* Oops, need to use ptr() here

* This test created a subinterpreter when PYBIND11_SUBINTERPRETER_SUPPORT was off

So the fix is really this test should not be run in these older versions at all.

The hang was a GIL issue between the subinterpreters during pybind11::exception::what().

* fix: standard mutex for 3.13t

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2025-05-18 09:39:26 -04:00
Henry Schreiner
094343c74a fix: support Python 3.14 (#5646)
* ci: support Python 3.14

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: Python 3.14 name change

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: fix expected output to handle Python 3.14

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: tighten CLI and add color on 3.14+

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: ignore failure on 3.14.0b1

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: support Python 3.14.0b1 with interperters

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update test_multiple_interpreters.py

* Update test_multiple_interpreters.py

* fix: new breakage for 3.14 fixed

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: handle empty annotations 3.14

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: Python 3.14 may not create the annotations dict

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: use PyUnstable_IsImmortal

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: use sys._is_immortal

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: ignore large values for refcount too

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* style: pre-commit fixes

* ci: enable all free-threaded builds

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: patch for embed

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Revert "fix: patch for embed"

This reverts commit c4226a0671.

* ci: drop new 3.xt additions

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: logic issue, also add some comments

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update include/pybind11/pytypes.h

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-16 21:58:43 -04:00
b-pass
1107c0936e docs: Add documentation for mod_gil_not_used and multiple_interpreters (#5659)
* Add documentation (advanced/misc) for mod_gil_not_used and multiple_interpreters options

* Add some comparison of free-threading vs sub-interpreters

* Formatting

* Reword for clarity

* style: pre-commit fixes

* Suggested changes, including a long-winded explaination of parallelism in python today

* Slight formatting updates and GPT suggested clarifications

* Better section title

* Update docs/advanced/misc.rst

Copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/advanced/misc.rst

Copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/advanced/misc.rst

* Add a deadlock warning, and minor corrections

* Rewrite the example to avoid free-threading risky behaviors

* Oops, missed a line in the example

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2025-05-16 19:45:38 -04:00