Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit dbe2f96

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#364)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 6311278 commit dbe2f96

File tree

11 files changed

+119
-133
lines changed

11 files changed

+119
-133
lines changed

.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "2.12.3" # {x-release-please-version}

google/cloud/kms_v1/services/ekm_service/async_client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from google.api_core.client_options import ClientOptions
3535
from google.auth import credentials as ga_credentials # type: ignore
3636
from google.oauth2 import service_account # type: ignore
37-
import pkg_resources
37+
38+
from google.cloud.kms_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -226,7 +227,7 @@ async def list_ekm_connections(
226227
*,
227228
parent: Optional[str] = None,
228229
retry: OptionalRetry = gapic_v1.method.DEFAULT,
229-
timeout: Optional[float] = None,
230+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
230231
metadata: Sequence[Tuple[str, str]] = (),
231232
) -> pagers.ListEkmConnectionsAsyncPager:
232233
r"""Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].
@@ -353,7 +354,7 @@ async def get_ekm_connection(
353354
*,
354355
name: Optional[str] = None,
355356
retry: OptionalRetry = gapic_v1.method.DEFAULT,
356-
timeout: Optional[float] = None,
357+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
357358
metadata: Sequence[Tuple[str, str]] = (),
358359
) -> ekm_service.EkmConnection:
359360
r"""Returns metadata for a given
@@ -480,7 +481,7 @@ async def create_ekm_connection(
480481
ekm_connection_id: Optional[str] = None,
481482
ekm_connection: Optional[ekm_service.EkmConnection] = None,
482483
retry: OptionalRetry = gapic_v1.method.DEFAULT,
483-
timeout: Optional[float] = None,
484+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
484485
metadata: Sequence[Tuple[str, str]] = (),
485486
) -> ekm_service.EkmConnection:
486487
r"""Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection]
@@ -626,7 +627,7 @@ async def update_ekm_connection(
626627
ekm_connection: Optional[ekm_service.EkmConnection] = None,
627628
update_mask: Optional[field_mask_pb2.FieldMask] = None,
628629
retry: OptionalRetry = gapic_v1.method.DEFAULT,
629-
timeout: Optional[float] = None,
630+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
630631
metadata: Sequence[Tuple[str, str]] = (),
631632
) -> ekm_service.EkmConnection:
632633
r"""Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s
@@ -759,7 +760,7 @@ async def set_iam_policy(
759760
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
760761
*,
761762
retry: OptionalRetry = gapic_v1.method.DEFAULT,
762-
timeout: Optional[float] = None,
763+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
763764
metadata: Sequence[Tuple[str, str]] = (),
764765
) -> policy_pb2.Policy:
765766
r"""Sets the IAM access control policy on the specified function.
@@ -878,7 +879,7 @@ async def get_iam_policy(
878879
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
879880
*,
880881
retry: OptionalRetry = gapic_v1.method.DEFAULT,
881-
timeout: Optional[float] = None,
882+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
882883
metadata: Sequence[Tuple[str, str]] = (),
883884
) -> policy_pb2.Policy:
884885
r"""Gets the IAM access control policy for a function.
@@ -999,7 +1000,7 @@ async def test_iam_permissions(
9991000
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
10001001
*,
10011002
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1002-
timeout: Optional[float] = None,
1003+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10031004
metadata: Sequence[Tuple[str, str]] = (),
10041005
) -> iam_policy_pb2.TestIamPermissionsResponse:
10051006
r"""Tests the specified permissions against the IAM access control
@@ -1060,14 +1061,9 @@ async def __aexit__(self, exc_type, exc, tb):
10601061
await self.transport.close()
10611062

10621063

1063-
try:
1064-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1065-
gapic_version=pkg_resources.get_distribution(
1066-
"google-cloud-kms",
1067-
).version,
1068-
)
1069-
except pkg_resources.DistributionNotFound:
1070-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1064+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1065+
gapic_version=package_version.__version__
1066+
)
10711067

10721068

10731069
__all__ = ("EkmServiceAsyncClient",)

google/cloud/kms_v1/services/ekm_service/client.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.kms_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -479,7 +480,7 @@ def list_ekm_connections(
479480
*,
480481
parent: Optional[str] = None,
481482
retry: OptionalRetry = gapic_v1.method.DEFAULT,
482-
timeout: Optional[float] = None,
483+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
483484
metadata: Sequence[Tuple[str, str]] = (),
484485
) -> pagers.ListEkmConnectionsPager:
485486
r"""Lists [EkmConnections][google.cloud.kms.v1.EkmConnection].
@@ -596,7 +597,7 @@ def get_ekm_connection(
596597
*,
597598
name: Optional[str] = None,
598599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
599-
timeout: Optional[float] = None,
600+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
600601
metadata: Sequence[Tuple[str, str]] = (),
601602
) -> ekm_service.EkmConnection:
602603
r"""Returns metadata for a given
@@ -713,7 +714,7 @@ def create_ekm_connection(
713714
ekm_connection_id: Optional[str] = None,
714715
ekm_connection: Optional[ekm_service.EkmConnection] = None,
715716
retry: OptionalRetry = gapic_v1.method.DEFAULT,
716-
timeout: Optional[float] = None,
717+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
717718
metadata: Sequence[Tuple[str, str]] = (),
718719
) -> ekm_service.EkmConnection:
719720
r"""Creates a new [EkmConnection][google.cloud.kms.v1.EkmConnection]
@@ -849,7 +850,7 @@ def update_ekm_connection(
849850
ekm_connection: Optional[ekm_service.EkmConnection] = None,
850851
update_mask: Optional[field_mask_pb2.FieldMask] = None,
851852
retry: OptionalRetry = gapic_v1.method.DEFAULT,
852-
timeout: Optional[float] = None,
853+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
853854
metadata: Sequence[Tuple[str, str]] = (),
854855
) -> ekm_service.EkmConnection:
855856
r"""Updates an [EkmConnection][google.cloud.kms.v1.EkmConnection]'s
@@ -985,7 +986,7 @@ def set_iam_policy(
985986
request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None,
986987
*,
987988
retry: OptionalRetry = gapic_v1.method.DEFAULT,
988-
timeout: Optional[float] = None,
989+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
989990
metadata: Sequence[Tuple[str, str]] = (),
990991
) -> policy_pb2.Policy:
991992
r"""Sets the IAM access control policy on the specified function.
@@ -1105,7 +1106,7 @@ def get_iam_policy(
11051106
request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None,
11061107
*,
11071108
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1108-
timeout: Optional[float] = None,
1109+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11091110
metadata: Sequence[Tuple[str, str]] = (),
11101111
) -> policy_pb2.Policy:
11111112
r"""Gets the IAM access control policy for a function.
@@ -1226,7 +1227,7 @@ def test_iam_permissions(
12261227
request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None,
12271228
*,
12281229
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1229-
timeout: Optional[float] = None,
1230+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12301231
metadata: Sequence[Tuple[str, str]] = (),
12311232
) -> iam_policy_pb2.TestIamPermissionsResponse:
12321233
r"""Tests the specified IAM permissions against the IAM access control
@@ -1281,14 +1282,9 @@ def test_iam_permissions(
12811282
return response
12821283

12831284

1284-
try:
1285-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1286-
gapic_version=pkg_resources.get_distribution(
1287-
"google-cloud-kms",
1288-
).version,
1289-
)
1290-
except pkg_resources.DistributionNotFound:
1291-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1285+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1286+
gapic_version=package_version.__version__
1287+
)
12921288

12931289

12941290
__all__ = ("EkmServiceClient",)

google/cloud/kms_v1/services/ekm_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@
2525
from google.iam.v1 import iam_policy_pb2 # type: ignore
2626
from google.iam.v1 import policy_pb2 # type: ignore
2727
from google.oauth2 import service_account # type: ignore
28-
import pkg_resources
2928

29+
from google.cloud.kms_v1 import gapic_version as package_version
3030
from google.cloud.kms_v1.types import ekm_service
3131

32-
try:
33-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
34-
gapic_version=pkg_resources.get_distribution(
35-
"google-cloud-kms",
36-
).version,
37-
)
38-
except pkg_resources.DistributionNotFound:
39-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
32+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33+
gapic_version=package_version.__version__
34+
)
4035

4136

4237
class EkmServiceTransport(abc.ABC):

0 commit comments

Comments
 (0)