Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 45212af

Browse files
authored
fix: Make gapic-generator-python compatible with protobuf 3.14.0 (packaged as native namespace package) (#753)
More details about Python namespace packaging here: https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages The protobuf changes, which made this fix necessary are here: protocolbuffers/protobuf#7902 protocolbuffers/protobuf#7908 The tracking bug for this issue (probably not the only one) googleapis/gapic-generator#3334 This is only part of the fix, for the proper fix other google-namespaced python packages must be migrated to [pkgutil-style-namespace-packages](https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages) and make sure they **do not** have `namespace_packages` in their `setup.py` file (an artifact from the legacy `pkg_resources-style`packages)
1 parent 608275a commit 45212af

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ py_binary(
5757
python_version = "PY3",
5858
visibility = ["//visibility:public"],
5959
deps = [
60-
"@com_google_protobuf//:protobuf_python",
6160
"@com_github_grpc_grpc//src/python/grpcio/grpc:grpcio",
61+
requirement("protobuf"),
6262
requirement("click"),
6363
requirement("google-api-core"),
6464
requirement("googleapis-common-protos"),

WORKSPACE

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
4444

4545
grpc_deps()
4646

47-
load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
47+
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
4848

49-
bazel_version_repository(
50-
name = "bazel_version",
51-
)
49+
grpc_extra_deps()
5250

5351
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
5452

repositories.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def gapic_generator_python():
1515
requirements = "@gapic_generator_python//:requirements.txt",
1616
)
1717

18-
_protobuf_version = "3.13.0"
18+
_protobuf_version = "3.14.0"
1919
_protobuf_version_in_link = "v%s" % _protobuf_version
2020
_maybe(
2121
http_archive,

0 commit comments

Comments
 (0)