Proto commits in pybind/pybind11_protobuf

These 12 commits are when the Protocol Buffers files have changed:

Commit:3f77b28
Author:Ralf W. Grosse-Kunstleve
Committer:Copybara-Service

Fix (also replace `-` with `_`) and rename `PythonPackageForDescriptor()`. Add tests covering the situations in which the problem was observed. PiperOrigin-RevId: 623374809

The documentation is generated from this commit.

Commit:0116cce
Author:Ralf W. Grosse-Kunstleve
Committer:Copybara-Service

Raise "Proto Message has an Unknown Field" in certain situations. The motivation for this change is to flag accidental loss of protobuf extensions when `use_fast_cpp_protos` is in use, to turn silent but potentially critical failures into noisy failures, for example: ``` Proto Message of type pybind11.test.NestRepeated has an Unknown Field with parent of type pybind11.test.BaseMessage: base_msgs.1003 (pybind11_protobuf/tests/extension_nest_repeated.proto, pybind11_protobuf/tests/extension.proto). Please add the required `cc_proto_library` `deps`. Only if there is no alternative to suppressing this error, use `pybind11_protobuf::AllowUnknownFieldsFor("pybind11.test.NestRepeated", "base_msgs");` (Warning: suppressions may mask critical bugs.) ``` See the updated "Protobuf Extensions" section in README.md for background and details. check_unknown_fields.cc is mostly the work of @laramiel, with an initial implementation only by @rwgk. `MessageMayContainExtensionsMemoized()` is for speed-up, but note that it also limits the scope of the Unknown Field detection (as explained in the updated README.md section). PiperOrigin-RevId: 468553207

Commit:f1dda84
Author:Ralf W. Grosse-Kunstleve
Committer:Copybara-Service

Add `test_extension_in_other_file*` subtests. To exercise & demonstrate under which conditions exactly extensions are lost. This is also meant to be a basis for working out a solution to what is marked as `SILENT FAILURE` in `test_extension_in_other_file_roundtrip_with_serialize_deserialize`. PiperOrigin-RevId: 458067172

Commit:a0195ed
Author:Laramie Leavitt
Committer:Copybara-Service

Introduce ADL functions to enable/disable specializations of type_caster<> provided by pybind11_protobuf. Defaults to enabled. To disable the pybind11_protobuf proto_caster for a specific proto type, define a constexpr function which is ADL visible (e.g in the same namespace; https://en.cppreference.com/w/cpp/language/adl) like: constexpr bool pybind11_protobuf_enable_type_caster(MyProto*) { return false; } constexpr bool pybind11_protobuf_enable_enum_type_caster(MyProto::Enum*) { return false; } This is useful to exclude types such as tensorstore::DType from using the pybind11_protobuf enum casters. PiperOrigin-RevId: 441927590

Commit:60f5b2e
Author:Laramie Leavitt
Committer:Ralf W. Grosse-Kunstleve

Internal change PiperOrigin-RevId: 381339017

Commit:3c5903c
Author:Laramie Leavitt
Committer:Ralf W. Grosse-Kunstleve

Internal change PiperOrigin-RevId: 380888079

Commit:ab49863
Author:pybind11_protobuf authors
Committer:Ralf W. Grosse-Kunstleve

Internal change PiperOrigin-RevId: 359833247

Commit:565c4c8
Author:Ken Oslund
Committer:Michael Chinen

Internal change PiperOrigin-RevId: 338677923

Commit:6d3cadc
Author:Ken Oslund
Committer:Michael Chinen

Internal change PiperOrigin-RevId: 329540600

Commit:dc34584
Author:Ken Oslund
Committer:Michael Chinen

Internal change PiperOrigin-RevId: 284671486

Commit:83e0c3d
Author:Ryan Hitchman
Committer:Michael Chinen

Internal change PiperOrigin-RevId: 281158825

Commit:1a33d53
Author:Ryan Hitchman
Committer:Michael Chinen

Internal change PiperOrigin-RevId: 280518091