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

Commit 1b585b3

Browse files
committed
for testing purposes
1 parent b7e0f7f commit 1b585b3

5 files changed

Lines changed: 19 additions & 1 deletion

File tree

gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ from google.api_core import gapic_v1
2424
from google.api_core import retry_async as retries
2525
from google.auth import credentials as ga_credentials # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27+
import google.protobuf
2728

2829
{{ shared_macros.add_google_api_core_version_header_import(service.version) }}
2930
try:
@@ -726,6 +727,9 @@ class {{ service.async_client_name }}:
726727

727728
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(gapic_version=package_version.__version__)
728729

730+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
731+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
732+
729733

730734
__all__ = (
731735
"{{ service.async_client_name }}",

gapic/templates/%namespace/%name_%version/%sub/services/%service/client.py.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ from google.auth.transport import mtls # type: ignore
3636
from google.auth.transport.grpc import SslCredentials # type: ignore
3737
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3838
from google.oauth2 import service_account # type: ignore
39+
import google.protobuf
3940
{{ shared_macros.add_google_api_core_version_header_import(service.version) }}
4041
try:
4142
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
@@ -991,6 +992,8 @@ class {{ service.client_name }}(metaclass={{ service.client_name }}Meta):
991992

992993
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(gapic_version=package_version.__version__)
993994

995+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
996+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
994997

995998
__all__ = (
996999
"{{ service.client_name }}",

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/base.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ from google.api_core import operations_v1
1818
{% endif %}
1919
from google.auth import credentials as ga_credentials # type: ignore
2020
from google.oauth2 import service_account # type: ignore
21+
import google.protobuf
2122

2223
{% filter sort_lines %}
2324
{% set import_ns = namespace(has_operations_mixin=false) %}
@@ -51,6 +52,9 @@ from {{ (api.naming.module_namespace + (api.naming.versioned_module_name,) + ser
5152

5253
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(gapic_version=package_version.__version__)
5354

55+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
56+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
57+
5458

5559
class {{ service.name }}Transport(abc.ABC):
5660
"""Abstract transport class for {{ service.name }}."""

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ from google.api_core import retry as retries
1313
from google.api_core import rest_helpers
1414
from google.api_core import rest_streaming
1515
from google.api_core import gapic_v1
16+
import google.protobuf
1617

1718
from google.protobuf import json_format
1819
{% if service.has_lro %}
@@ -55,6 +56,9 @@ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
5556
rest_version=f"requests@{requests_version}",
5657
)
5758

59+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
60+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
61+
5862

5963
{{ shared_macros.create_interceptor_class(api, service, method, is_async=False) }}
6064

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ from google.cloud.location import locations_pb2 # type: ignore
3434
from google.api_core import retry_async as retries
3535
from google.api_core import rest_helpers
3636
from google.api_core import rest_streaming_async # type: ignore
37-
37+
import google.protobuf
3838

3939
from google.protobuf import json_format
4040
{% if service.has_lro %}
@@ -80,6 +80,9 @@ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
8080
rest_version=f"google-auth@{google.auth.__version__}",
8181
)
8282

83+
if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER
84+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
85+
8386
{{ shared_macros.create_interceptor_class(api, service, method, is_async=True) }}
8487

8588
@dataclasses.dataclass

0 commit comments

Comments
 (0)