Skip to content

Commit f346779

Browse files
ericsalocopybara-github
authored andcommitted
cleanup: remove api_version from BUILD files
PiperOrigin-RevId: 677657197
1 parent 55916e1 commit f346779

23 files changed

+66
-62
lines changed

pybind11_protobuf/BUILD

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pybind_library(
1111
"//visibility:public",
1212
],
1313
deps = [
14-
"@com_google_protobuf//:protobuf",
14+
"//net/proto2/public",
1515
],
1616
)
1717

@@ -25,8 +25,8 @@ pybind_library(
2525
":check_unknown_fields",
2626
":enum_type_caster",
2727
":proto_cast_util",
28+
"//net/proto2/public",
2829
"@com_google_absl//absl/strings:string_view",
29-
"@com_google_protobuf//:protobuf",
3030
],
3131
)
3232

@@ -39,6 +39,8 @@ pybind_library(
3939
],
4040
deps = [
4141
":check_unknown_fields",
42+
"//net/proto2/proto:descriptor_cc_proto",
43+
"//net/proto2/public",
4244
"@com_google_absl//absl/container:flat_hash_map",
4345
"@com_google_absl//absl/log",
4446
"@com_google_absl//absl/log:check",
@@ -58,9 +60,9 @@ pybind_library(
5860
],
5961
deps = [
6062
":proto_cast_util",
63+
"//net/proto2/public",
6164
"@com_google_absl//absl/status:statusor",
6265
"@com_google_absl//absl/types:optional",
63-
"@com_google_protobuf//:protobuf",
6466
],
6567
)
6668

@@ -69,13 +71,13 @@ cc_library(
6971
srcs = ["check_unknown_fields.cc"],
7072
hdrs = ["check_unknown_fields.h"],
7173
deps = [
74+
"//net/proto2/public",
75+
"//net/proto2/python/public:proto_api",
7276
"@com_google_absl//absl/container:flat_hash_map",
7377
"@com_google_absl//absl/container:flat_hash_set",
7478
"@com_google_absl//absl/meta:type_traits",
7579
"@com_google_absl//absl/strings",
7680
"@com_google_absl//absl/synchronization",
77-
"@com_google_protobuf//:protobuf",
78-
"@com_google_protobuf//python:proto_api",
7981
],
8082
)
8183

pybind11_protobuf/check_unknown_fields.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <string>
77
#include <vector>
88

9-
#include "google/protobuf/descriptor.h"
10-
#include "google/protobuf/message.h"
11-
#include "google/protobuf/unknown_field_set.h"
9+
#include "net/proto2/public/descriptor.h"
10+
#include "net/proto2/public/message.h"
11+
#include "net/proto2/public/unknown_field_set.h"
1212
#include "absl/container/flat_hash_map.h"
1313
#include "absl/container/flat_hash_set.h"
1414
#include "absl/strings/str_cat.h"

pybind11_protobuf/check_unknown_fields.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <optional>
55

6-
#include "google/protobuf/message.h"
7-
#include "python/google/protobuf/proto_api.h"
6+
#include "net/proto2/public/message.h"
7+
#include "net/proto2/python/public/proto_api.h"
88
#include "absl/strings/string_view.h"
99

1010
namespace pybind11_protobuf::check_unknown_fields {

pybind11_protobuf/enum_type_caster.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include <string>
1515
#include <type_traits>
1616

17-
#include "google/protobuf/descriptor.h"
18-
#include "google/protobuf/generated_enum_reflection.h"
19-
#include "google/protobuf/generated_enum_util.h"
17+
#include "net/proto2/public/descriptor.h"
18+
#include "net/proto2/public/generated_enum_reflection.h"
19+
#include "net/proto2/public/generated_enum_util.h"
2020

2121
// pybind11 type_caster specialization which translates Proto::Enum types
2222
// to/from ints. This will have ODR conflicts when users specify wrappers for

pybind11_protobuf/native_proto_caster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <type_traits>
1919
#include <utility>
2020

21-
#include "google/protobuf/message.h"
21+
#include "net/proto2/public/message.h"
2222
#include "absl/strings/string_view.h"
2323
#include "pybind11_protobuf/enum_type_caster.h"
2424
#include "pybind11_protobuf/proto_caster_impl.h"

pybind11_protobuf/proto_cast_util.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <utility>
1414
#include <vector>
1515

16-
#include "google/protobuf/descriptor.pb.h"
16+
#include "net/proto2/proto/descriptor.pb.h"
1717
#include "absl/container/flat_hash_map.h"
1818
#include "absl/log/check.h"
1919
#include "absl/log/log.h"
@@ -183,11 +183,11 @@ GlobalState::GlobalState() {
183183

184184
// pybind11_protobuf casting needs a dependency on proto internals to work.
185185
try {
186-
ImportCached("google.protobuf.descriptor");
186+
ImportCached("google3.net.proto2.python.public.descriptor");
187187
auto descriptor_pool =
188-
ImportCached("google.protobuf.descriptor_pool");
188+
ImportCached("google3.net.proto2.python.public.descriptor_pool");
189189
auto message_factory =
190-
ImportCached("google.protobuf.message_factory");
190+
ImportCached("google3.net.proto2.python.public.message_factory");
191191
global_pool_ = descriptor_pool.attr("Default")();
192192
find_message_type_by_name_ = global_pool_.attr("FindMessageTypeByName");
193193
if (hasattr(message_factory, "GetMessageClass")) {

pybind11_protobuf/proto_cast_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#include <type_traits>
1313
#include <utility>
1414

15-
#include "google/protobuf/descriptor.h"
16-
#include "google/protobuf/message.h"
15+
#include "net/proto2/public/descriptor.h"
16+
#include "net/proto2/public/message.h"
1717
#include "absl/strings/string_view.h"
1818
#include "absl/types/optional.h"
1919

pybind11_protobuf/proto_caster_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include <type_traits>
1616
#include <utility>
1717

18-
#include "google/protobuf/descriptor.pb.h"
19-
#include "google/protobuf/descriptor.h"
20-
#include "google/protobuf/message.h"
18+
#include "net/proto2/proto/descriptor.pb.h"
19+
#include "net/proto2/public/descriptor.h"
20+
#include "net/proto2/public/message.h"
2121
#include "pybind11_protobuf/proto_cast_util.h"
2222

2323
// Enables unsafe conversions; currently these are a work in progress.

pybind11_protobuf/proto_utils.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#include <stdexcept>
1313
#include <string>
1414

15-
#include "google/protobuf/descriptor.pb.h"
16-
#include "google/protobuf/descriptor.h"
17-
#include "google/protobuf/message.h"
18-
#include "google/protobuf/reflection.h"
15+
#include "net/proto2/proto/descriptor.pb.h"
16+
#include "net/proto2/public/descriptor.h"
17+
#include "net/proto2/public/message.h"
18+
#include "net/proto2/public/reflection.h"
1919
#include "absl/strings/str_cat.h"
2020
#include "absl/strings/string_view.h"
2121

pybind11_protobuf/proto_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <memory>
1212

13-
#include "google/protobuf/message.h"
13+
#include "net/proto2/public/message.h"
1414

1515
namespace pybind11 {
1616
namespace google {

0 commit comments

Comments
 (0)