Content-Length: 1118257 | pFad | https://github.com/googleapis/python-gke-hub/commit/75f63cd91615c740e7a59d035e0d8671557b66a2

91 fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#214) · googleapis/python-gke-hub@75f63cd · GitHub
Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 75f63cd

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#214)
* 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 * fix(deps): require google-api-core>=1.34.0,>=2.11.0 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent cd4e739 commit 75f63cd

23 files changed

+173
-136
lines changed

.coveragerc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ branch = True
44
[report]
55
show_missing = True
66
omit =
7-
google/cloud/gkehub/__init__.py
7+
google/cloud/gkehub/multiclusteringress/__init__.py
88
exclude_lines =
99
# Re-enable the standard pragma
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__ = "1.5.3" # {x-release-please-version}
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__ = "1.5.3" # {x-release-please-version}
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__ = "1.5.3" # {x-release-please-version}

google/cloud/gkehub_v1/services/gke_hub/async_client.py

Lines changed: 22 additions & 26 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.gkehub_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -231,7 +232,7 @@ async def list_memberships(
231232
*,
232233
parent: Optional[str] = None,
233234
retry: OptionalRetry = gapic_v1.method.DEFAULT,
234-
timeout: Optional[float] = None,
235+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
235236
metadata: Sequence[Tuple[str, str]] = (),
236237
) -> pagers.ListMembershipsAsyncPager:
237238
r"""Lists Memberships in a given project and location.
@@ -346,7 +347,7 @@ async def list_features(
346347
*,
347348
parent: Optional[str] = None,
348349
retry: OptionalRetry = gapic_v1.method.DEFAULT,
349-
timeout: Optional[float] = None,
350+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
350351
metadata: Sequence[Tuple[str, str]] = (),
351352
) -> pagers.ListFeaturesAsyncPager:
352353
r"""Lists Features in a given project and location.
@@ -460,7 +461,7 @@ async def get_membership(
460461
*,
461462
name: Optional[str] = None,
462463
retry: OptionalRetry = gapic_v1.method.DEFAULT,
463-
timeout: Optional[float] = None,
464+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
464465
metadata: Sequence[Tuple[str, str]] = (),
465466
) -> membership.Membership:
466467
r"""Gets the details of a Membership.
@@ -562,7 +563,7 @@ async def get_feature(
562563
*,
563564
name: Optional[str] = None,
564565
retry: OptionalRetry = gapic_v1.method.DEFAULT,
565-
timeout: Optional[float] = None,
566+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
566567
metadata: Sequence[Tuple[str, str]] = (),
567568
) -> feature.Feature:
568569
r"""Gets details of a single Feature.
@@ -665,7 +666,7 @@ async def create_membership(
665666
resource: Optional[membership.Membership] = None,
666667
membership_id: Optional[str] = None,
667668
retry: OptionalRetry = gapic_v1.method.DEFAULT,
668-
timeout: Optional[float] = None,
669+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
669670
metadata: Sequence[Tuple[str, str]] = (),
670671
) -> operation_async.AsyncOperation:
671672
r"""Creates a new Membership.
@@ -700,7 +701,7 @@ async def sample_create_membership():
700701
701702
print("Waiting for operation to complete...")
702703
703-
response = await operation.result()
704+
response = (await operation).result()
704705
705706
# Handle the response
706707
print(response)
@@ -816,7 +817,7 @@ async def create_feature(
816817
resource: Optional[feature.Feature] = None,
817818
feature_id: Optional[str] = None,
818819
retry: OptionalRetry = gapic_v1.method.DEFAULT,
819-
timeout: Optional[float] = None,
820+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
820821
metadata: Sequence[Tuple[str, str]] = (),
821822
) -> operation_async.AsyncOperation:
822823
r"""Adds a new Feature.
@@ -845,7 +846,7 @@ async def sample_create_feature():
845846
846847
print("Waiting for operation to complete...")
847848
848-
response = await operation.result()
849+
response = (await operation).result()
849850
850851
# Handle the response
851852
print(response)
@@ -947,7 +948,7 @@ async def delete_membership(
947948
*,
948949
name: Optional[str] = None,
949950
retry: OptionalRetry = gapic_v1.method.DEFAULT,
950-
timeout: Optional[float] = None,
951+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
951952
metadata: Sequence[Tuple[str, str]] = (),
952953
) -> operation_async.AsyncOperation:
953954
r"""Removes a Membership.
@@ -982,7 +983,7 @@ async def sample_delete_membership():
982983
983984
print("Waiting for operation to complete...")
984985
985-
response = await operation.result()
986+
response = (await operation).result()
986987
987988
# Handle the response
988989
print(response)
@@ -1076,7 +1077,7 @@ async def delete_feature(
10761077
*,
10771078
name: Optional[str] = None,
10781079
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1079-
timeout: Optional[float] = None,
1080+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10801081
metadata: Sequence[Tuple[str, str]] = (),
10811082
) -> operation_async.AsyncOperation:
10821083
r"""Removes a Feature.
@@ -1105,7 +1106,7 @@ async def sample_delete_feature():
11051106
11061107
print("Waiting for operation to complete...")
11071108
1108-
response = await operation.result()
1109+
response = (await operation).result()
11091110
11101111
# Handle the response
11111112
print(response)
@@ -1201,7 +1202,7 @@ async def update_membership(
12011202
resource: Optional[membership.Membership] = None,
12021203
update_mask: Optional[field_mask_pb2.FieldMask] = None,
12031204
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1204-
timeout: Optional[float] = None,
1205+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12051206
metadata: Sequence[Tuple[str, str]] = (),
12061207
) -> operation_async.AsyncOperation:
12071208
r"""Updates an existing Membership.
@@ -1231,7 +1232,7 @@ async def sample_update_membership():
12311232
12321233
print("Waiting for operation to complete...")
12331234
1234-
response = await operation.result()
1235+
response = (await operation).result()
12351236
12361237
# Handle the response
12371238
print(response)
@@ -1343,7 +1344,7 @@ async def update_feature(
13431344
resource: Optional[feature.Feature] = None,
13441345
update_mask: Optional[field_mask_pb2.FieldMask] = None,
13451346
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1346-
timeout: Optional[float] = None,
1347+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13471348
metadata: Sequence[Tuple[str, str]] = (),
13481349
) -> operation_async.AsyncOperation:
13491350
r"""Updates an existing Feature.
@@ -1372,7 +1373,7 @@ async def sample_update_feature():
13721373
13731374
print("Waiting for operation to complete...")
13741375
1375-
response = await operation.result()
1376+
response = (await operation).result()
13761377
13771378
# Handle the response
13781379
print(response)
@@ -1481,7 +1482,7 @@ async def generate_connect_manifest(
14811482
request: Optional[Union[service.GenerateConnectManifestRequest, dict]] = None,
14821483
*,
14831484
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1484-
timeout: Optional[float] = None,
1485+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14851486
metadata: Sequence[Tuple[str, str]] = (),
14861487
) -> service.GenerateConnectManifestResponse:
14871488
r"""Generates the manifest for deployment of the GKE connect agent.
@@ -1568,14 +1569,9 @@ async def __aexit__(self, exc_type, exc, tb):
15681569
await self.transport.close()
15691570

15701571

1571-
try:
1572-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1573-
gapic_version=pkg_resources.get_distribution(
1574-
"google-cloud-gke-hub",
1575-
).version,
1576-
)
1577-
except pkg_resources.DistributionNotFound:
1578-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1572+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1573+
gapic_version=package_version.__version__
1574+
)
15791575

15801576

15811577
__all__ = ("GkeHubAsyncClient",)

google/cloud/gkehub_v1/services/gke_hub/client.py

Lines changed: 16 additions & 20 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.gkehub_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -488,7 +489,7 @@ def list_memberships(
488489
*,
489490
parent: Optional[str] = None,
490491
retry: OptionalRetry = gapic_v1.method.DEFAULT,
491-
timeout: Optional[float] = None,
492+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
492493
metadata: Sequence[Tuple[str, str]] = (),
493494
) -> pagers.ListMembershipsPager:
494495
r"""Lists Memberships in a given project and location.
@@ -603,7 +604,7 @@ def list_features(
603604
*,
604605
parent: Optional[str] = None,
605606
retry: OptionalRetry = gapic_v1.method.DEFAULT,
606-
timeout: Optional[float] = None,
607+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
607608
metadata: Sequence[Tuple[str, str]] = (),
608609
) -> pagers.ListFeaturesPager:
609610
r"""Lists Features in a given project and location.
@@ -717,7 +718,7 @@ def get_membership(
717718
*,
718719
name: Optional[str] = None,
719720
retry: OptionalRetry = gapic_v1.method.DEFAULT,
720-
timeout: Optional[float] = None,
721+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
721722
metadata: Sequence[Tuple[str, str]] = (),
722723
) -> membership.Membership:
723724
r"""Gets the details of a Membership.
@@ -819,7 +820,7 @@ def get_feature(
819820
*,
820821
name: Optional[str] = None,
821822
retry: OptionalRetry = gapic_v1.method.DEFAULT,
822-
timeout: Optional[float] = None,
823+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
823824
metadata: Sequence[Tuple[str, str]] = (),
824825
) -> feature.Feature:
825826
r"""Gets details of a single Feature.
@@ -922,7 +923,7 @@ def create_membership(
922923
resource: Optional[membership.Membership] = None,
923924
membership_id: Optional[str] = None,
924925
retry: OptionalRetry = gapic_v1.method.DEFAULT,
925-
timeout: Optional[float] = None,
926+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
926927
metadata: Sequence[Tuple[str, str]] = (),
927928
) -> operation.Operation:
928929
r"""Creates a new Membership.
@@ -1073,7 +1074,7 @@ def create_feature(
10731074
resource: Optional[feature.Feature] = None,
10741075
feature_id: Optional[str] = None,
10751076
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1076-
timeout: Optional[float] = None,
1077+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10771078
metadata: Sequence[Tuple[str, str]] = (),
10781079
) -> operation.Operation:
10791080
r"""Adds a new Feature.
@@ -1204,7 +1205,7 @@ def delete_membership(
12041205
*,
12051206
name: Optional[str] = None,
12061207
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1207-
timeout: Optional[float] = None,
1208+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12081209
metadata: Sequence[Tuple[str, str]] = (),
12091210
) -> operation.Operation:
12101211
r"""Removes a Membership.
@@ -1333,7 +1334,7 @@ def delete_feature(
13331334
*,
13341335
name: Optional[str] = None,
13351336
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1336-
timeout: Optional[float] = None,
1337+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13371338
metadata: Sequence[Tuple[str, str]] = (),
13381339
) -> operation.Operation:
13391340
r"""Removes a Feature.
@@ -1458,7 +1459,7 @@ def update_membership(
14581459
resource: Optional[membership.Membership] = None,
14591460
update_mask: Optional[field_mask_pb2.FieldMask] = None,
14601461
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1461-
timeout: Optional[float] = None,
1462+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14621463
metadata: Sequence[Tuple[str, str]] = (),
14631464
) -> operation.Operation:
14641465
r"""Updates an existing Membership.
@@ -1600,7 +1601,7 @@ def update_feature(
16001601
resource: Optional[feature.Feature] = None,
16011602
update_mask: Optional[field_mask_pb2.FieldMask] = None,
16021603
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1603-
timeout: Optional[float] = None,
1604+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16041605
metadata: Sequence[Tuple[str, str]] = (),
16051606
) -> operation.Operation:
16061607
r"""Updates an existing Feature.
@@ -1738,7 +1739,7 @@ def generate_connect_manifest(
17381739
request: Optional[Union[service.GenerateConnectManifestRequest, dict]] = None,
17391740
*,
17401741
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1741-
timeout: Optional[float] = None,
1742+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17421743
metadata: Sequence[Tuple[str, str]] = (),
17431744
) -> service.GenerateConnectManifestResponse:
17441745
r"""Generates the manifest for deployment of the GKE connect agent.
@@ -1835,14 +1836,9 @@ def __exit__(self, type, value, traceback):
18351836
self.transport.close()
18361837

18371838

1838-
try:
1839-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1840-
gapic_version=pkg_resources.get_distribution(
1841-
"google-cloud-gke-hub",
1842-
).version,
1843-
)
1844-
except pkg_resources.DistributionNotFound:
1845-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1839+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1840+
gapic_version=package_version.__version__
1841+
)
18461842

18471843

18481844
__all__ = ("GkeHubClient",)

google/cloud/gkehub_v1/services/gke_hub/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.gkehub_v1 import gapic_version as package_version
2929
from google.cloud.gkehub_v1.types import feature, membership, service
3030

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

4035

4136
class GkeHubTransport(abc.ABC):

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-gke-hub/commit/75f63cd91615c740e7a59d035e0d8671557b66a2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy