Skip to content

Commit 55edcab

Browse files
committed
chore: bump minimum version of protobuf to
1 parent 14a5978 commit 55edcab

File tree

7 files changed

+6
-46
lines changed

7 files changed

+6
-46
lines changed

google/api_core/grpc_helpers.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@
2626
import google.auth.credentials
2727
import google.auth.transport.grpc
2828
import google.auth.transport.requests
29-
import google.protobuf
30-
31-
PROTOBUF_VERSION = google.protobuf.__version__
32-
33-
# The grpcio-gcp package only has support for protobuf < 4
34-
if PROTOBUF_VERSION[0:2] == "3.": # pragma: NO COVER
35-
try:
36-
import grpc_gcp
37-
38-
warnings.warn(
39-
"""Support for grpcio-gcp is deprecated. This feature will be
40-
removed from `google-api-core` after January 1, 2024. If you need to
41-
continue to use this feature, please pin to a specific version of
42-
`google-api-core`.""",
43-
DeprecationWarning,
44-
)
45-
HAS_GRPC_GCP = True
46-
except ImportError:
47-
HAS_GRPC_GCP = False
48-
else:
49-
HAS_GRPC_GCP = False
5029

5130

5231
# The list of gRPC Callable interfaces that return iterators.

google/api_core/operations_v1/transports/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def _convert_protobuf_message_to_dict(
235235
A dict representation of the protocol buffer message.
236236
"""
237237
# TODO(https://github.com/googleapis/python-api-core/issues/643): For backwards compatibility
238-
# with protobuf 3.x 4.x, Remove once support for protobuf 3.x and 4.x is dropped.
239-
if PROTOBUF_VERSION[0:2] in ["3.", "4."]:
238+
# with protobuf 4.x, Remove once support for protobuf 4.x is dropped.
239+
if PROTOBUF_VERSION[0:2] == "4.":
240240
result = json_format.MessageToDict(
241241
message,
242242
preserving_proto_field_name=True,

noxfile.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -225,25 +225,6 @@ def unit_w_prerelease_deps(session):
225225
default(session, prerelease=True)
226226

227227

228-
@nox.session(python=PYTHON_VERSIONS)
229-
def unit_grpc_gcp(session):
230-
"""
231-
Run the unit test suite with grpcio-gcp installed.
232-
`grpcio-gcp` doesn't support protobuf 4+.
233-
Remove extra `grpcgcp` when protobuf 3.x is dropped.
234-
https://github.com/googleapis/python-api-core/issues/594
235-
"""
236-
constraints_path = str(
237-
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
238-
)
239-
# Install grpcio-gcp
240-
session.install("-e", ".[grpcgcp]", "-c", constraints_path)
241-
# Install protobuf < 4.0.0
242-
session.install("protobuf<4.0.0")
243-
244-
default(session)
245-
246-
247228
@nox.session(python=PYTHON_VERSIONS)
248229
def unit_wo_grpc(session):
249230
"""Run the unit test suite w/o grpcio installed"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ classifiers = [
4545
]
4646
dependencies = [
4747
"googleapis-common-protos >= 1.56.2, < 2.0.0",
48-
"protobuf >= 3.19.5, < 7.0.0, != 3.20.0, != 3.20.1, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5",
48+
"protobuf >= 4.25.8, < 7.0.0, != 3.20.0, != 3.20.1, != 4.21.0, != 4.21.1, != 4.21.2, != 4.21.3, != 4.21.4, != 4.21.5",
4949
"proto-plus >= 1.22.3, < 2.0.0",
5050
"proto-plus >= 1.25.0, < 2.0.0; python_version >= '3.13'",
5151
"google-auth >= 2.14.1, < 3.0.0",

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
88
googleapis-common-protos==1.56.2
9-
protobuf==3.19.5
9+
protobuf==4.25.8
1010
google-auth==2.14.1
1111
requests==2.18.0
1212
grpcio==1.33.2

testing/constraints-3.8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
googleapis-common-protos==1.56.3
2-
protobuf==4.21.6
2+
protobuf==4.25.8

testing/constraints-async-rest-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
77
# Then this file should have foo==1.14.0
88
googleapis-common-protos==1.56.2
9-
protobuf==3.19.5
9+
protobuf==4.25.8
1010
google-auth==2.35.0
1111
# from google-auth[aiohttp]
1212
aiohttp==3.6.2

0 commit comments

Comments
 (0)