Skip to content

Commit df27249

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 df27249

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pybind11_protobuf/BUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ pybind_library(
5858
}),
5959
deps = [
6060
":check_unknown_fields",
61+
"//third_party/protobuf",
62+
"//third_party/py/google/protobuf:proto_api",
6163
"@com_google_absl//absl/container:flat_hash_map",
64+
"@com_google_absl//absl/log",
65+
"@com_google_absl//absl/log:check",
66+
"@com_google_absl//absl/memory",
6267
"@com_google_absl//absl/strings",
6368
"@com_google_absl//absl/types:optional",
6469
"@com_google_protobuf//:protobuf",
65-
"@com_google_protobuf//python:proto_api",
6670
],
6771
)
6872

pybind11_protobuf/proto_cast_util.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@
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 "third_party/protobuf/descriptor.h"
24+
#include "third_party/protobuf/descriptor_database.h"
25+
#include "third_party/protobuf/dynamic_message.h"
26+
#include "third_party/py/google/protobuf/proto_api.h"
2627
#include "pybind11_protobuf/check_unknown_fields.h"
2728

2829
namespace py = pybind11;
2930

3031
using ::google::protobuf::Descriptor;
3132
using ::google::protobuf::DescriptorDatabase;
3233
using ::google::protobuf::DescriptorPool;
33-
using ::google::protobuf::DescriptorProto;
3434
using ::google::protobuf::DynamicMessageFactory;
3535
using ::google::protobuf::FileDescriptor;
3636
using ::google::protobuf::FileDescriptorProto;

0 commit comments

Comments
 (0)