Skip to content

Commit 93f3870

Browse files
pybind11_protobuf authorscopybara-github
pybind11_protobuf authors
authored andcommitted
Expose new python wrappers for C++ proto descriptor classes.
PiperOrigin-RevId: 594634311
1 parent 8359a09 commit 93f3870

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

pybind11_protobuf/BUILD

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ pybind_library(
5959
deps = [
6060
":check_unknown_fields",
6161
"@com_google_absl//absl/container:flat_hash_map",
62+
"@com_google_absl//absl/log",
63+
"@com_google_absl//absl/log:check",
64+
"@com_google_absl//absl/memory",
6265
"@com_google_absl//absl/strings",
6366
"@com_google_absl//absl/types:optional",
6467
"@com_google_protobuf//:protobuf",

pybind11_protobuf/proto_cast_util.cc

+13-8
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,33 @@
99
#include <iostream>
1010
#include <memory>
1111
#include <string>
12-
#include <type_traits>
1312
#include <utility>
13+
#include <vector>
1414

1515
#include "google/protobuf/descriptor.pb.h"
16-
#include "google/protobuf/descriptor.h"
17-
#include "google/protobuf/dynamic_message.h"
18-
#include "google/protobuf/message.h"
19-
#include "python/google/protobuf/proto_api.h"
2016
#include "absl/container/flat_hash_map.h"
21-
#include "absl/strings/numbers.h"
17+
#include "absl/log/check.h"
18+
#include "absl/log/log.h"
19+
#include "absl/memory/memory.h"
2220
#include "absl/strings/str_replace.h"
23-
#include "absl/strings/str_split.h"
2421
#include "absl/strings/string_view.h"
2522
#include "absl/types/optional.h"
23+
#include "google/protobuf/descriptor.h"
24+
#include "google/protobuf/descriptor_database.h"
25+
#include "google/protobuf/dynamic_message.h"
26+
#include "python/google/protobuf/proto_api.h"
2627
#include "pybind11_protobuf/check_unknown_fields.h"
2728

29+
#if defined(GOOGLE_PROTOBUF_VERSION)
30+
#include "absl/strings/numbers.h"
31+
#include "absl/strings/str_split.h"
32+
#endif
33+
2834
namespace py = pybind11;
2935

3036
using ::google::protobuf::Descriptor;
3137
using ::google::protobuf::DescriptorDatabase;
3238
using ::google::protobuf::DescriptorPool;
33-
using ::google::protobuf::DescriptorProto;
3439
using ::google::protobuf::DynamicMessageFactory;
3540
using ::google::protobuf::FileDescriptor;
3641
using ::google::protobuf::FileDescriptorProto;

0 commit comments

Comments
 (0)