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

Commit 1e94a02

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

29 files changed

+225
-252
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__ = "1.1.2" # {x-release-please-version}

google/cloud/dataplex_v1/services/content_service/async_client.py

Lines changed: 19 additions & 23 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.dataplex_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 create_content(
231232
parent: Optional[str] = None,
232233
content: Optional[analyze.Content] = 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
) -> analyze.Content:
237238
r"""Create a content.
@@ -346,7 +347,7 @@ async def update_content(
346347
content: Optional[analyze.Content] = None,
347348
update_mask: Optional[field_mask_pb2.FieldMask] = 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
) -> analyze.Content:
352353
r"""Update a content. Only supports full resource update.
@@ -461,7 +462,7 @@ async def delete_content(
461462
*,
462463
name: Optional[str] = None,
463464
retry: OptionalRetry = gapic_v1.method.DEFAULT,
464-
timeout: Optional[float] = None,
465+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
465466
metadata: Sequence[Tuple[str, str]] = (),
466467
) -> None:
467468
r"""Delete a content.
@@ -550,7 +551,7 @@ async def get_content(
550551
*,
551552
name: Optional[str] = None,
552553
retry: OptionalRetry = gapic_v1.method.DEFAULT,
553-
timeout: Optional[float] = None,
554+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
554555
metadata: Sequence[Tuple[str, str]] = (),
555556
) -> analyze.Content:
556557
r"""Get a content resource.
@@ -660,7 +661,7 @@ async def get_iam_policy(
660661
*,
661662
resource: Optional[str] = None,
662663
retry: OptionalRetry = gapic_v1.method.DEFAULT,
663-
timeout: Optional[float] = None,
664+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
664665
metadata: Sequence[Tuple[str, str]] = (),
665666
) -> policy_pb2.Policy:
666667
r"""Gets the access control policy for a contentitem resource. A
@@ -840,7 +841,7 @@ async def set_iam_policy(
840841
request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None,
841842
*,
842843
retry: OptionalRetry = gapic_v1.method.DEFAULT,
843-
timeout: Optional[float] = None,
844+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
844845
metadata: Sequence[Tuple[str, str]] = (),
845846
) -> policy_pb2.Policy:
846847
r"""Sets the access control policy on the specified contentitem
@@ -987,7 +988,7 @@ async def test_iam_permissions(
987988
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
988989
*,
989990
retry: OptionalRetry = gapic_v1.method.DEFAULT,
990-
timeout: Optional[float] = None,
991+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
991992
metadata: Sequence[Tuple[str, str]] = (),
992993
) -> iam_policy_pb2.TestIamPermissionsResponse:
993994
r"""Returns the caller's permissions on a resource. If the resource
@@ -1090,7 +1091,7 @@ async def list_content(
10901091
*,
10911092
parent: Optional[str] = None,
10921093
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1093-
timeout: Optional[float] = None,
1094+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10941095
metadata: Sequence[Tuple[str, str]] = (),
10951096
) -> pagers.ListContentAsyncPager:
10961097
r"""List content.
@@ -1212,7 +1213,7 @@ async def list_operations(
12121213
request: Optional[operations_pb2.ListOperationsRequest] = None,
12131214
*,
12141215
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1215-
timeout: Optional[float] = None,
1216+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12161217
metadata: Sequence[Tuple[str, str]] = (),
12171218
) -> operations_pb2.ListOperationsResponse:
12181219
r"""Lists operations that match the specified filter in the request.
@@ -1266,7 +1267,7 @@ async def get_operation(
12661267
request: Optional[operations_pb2.GetOperationRequest] = None,
12671268
*,
12681269
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1269-
timeout: Optional[float] = None,
1270+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12701271
metadata: Sequence[Tuple[str, str]] = (),
12711272
) -> operations_pb2.Operation:
12721273
r"""Gets the latest state of a long-running operation.
@@ -1320,7 +1321,7 @@ async def delete_operation(
13201321
request: Optional[operations_pb2.DeleteOperationRequest] = None,
13211322
*,
13221323
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1323-
timeout: Optional[float] = None,
1324+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13241325
metadata: Sequence[Tuple[str, str]] = (),
13251326
) -> None:
13261327
r"""Deletes a long-running operation.
@@ -1375,7 +1376,7 @@ async def cancel_operation(
13751376
request: Optional[operations_pb2.CancelOperationRequest] = None,
13761377
*,
13771378
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1378-
timeout: Optional[float] = None,
1379+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13791380
metadata: Sequence[Tuple[str, str]] = (),
13801381
) -> None:
13811382
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1429,7 +1430,7 @@ async def get_location(
14291430
request: Optional[locations_pb2.GetLocationRequest] = None,
14301431
*,
14311432
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1432-
timeout: Optional[float] = None,
1433+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14331434
metadata: Sequence[Tuple[str, str]] = (),
14341435
) -> locations_pb2.Location:
14351436
r"""Gets information about a location.
@@ -1483,7 +1484,7 @@ async def list_locations(
14831484
request: Optional[locations_pb2.ListLocationsRequest] = None,
14841485
*,
14851486
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1486-
timeout: Optional[float] = None,
1487+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14871488
metadata: Sequence[Tuple[str, str]] = (),
14881489
) -> locations_pb2.ListLocationsResponse:
14891490
r"""Lists information about the supported locations for this service.
@@ -1539,14 +1540,9 @@ async def __aexit__(self, exc_type, exc, tb):
15391540
await self.transport.close()
15401541

15411542

1542-
try:
1543-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1544-
gapic_version=pkg_resources.get_distribution(
1545-
"google-cloud-dataplex",
1546-
).version,
1547-
)
1548-
except pkg_resources.DistributionNotFound:
1549-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1543+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1544+
gapic_version=package_version.__version__
1545+
)
15501546

15511547

15521548
__all__ = ("ContentServiceAsyncClient",)

google/cloud/dataplex_v1/services/content_service/client.py

Lines changed: 19 additions & 23 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.dataplex_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -480,7 +481,7 @@ def create_content(
480481
parent: Optional[str] = None,
481482
content: Optional[analyze.Content] = 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
) -> analyze.Content:
486487
r"""Create a content.
@@ -595,7 +596,7 @@ def update_content(
595596
content: Optional[analyze.Content] = None,
596597
update_mask: Optional[field_mask_pb2.FieldMask] = None,
597598
retry: OptionalRetry = gapic_v1.method.DEFAULT,
598-
timeout: Optional[float] = None,
599+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
599600
metadata: Sequence[Tuple[str, str]] = (),
600601
) -> analyze.Content:
601602
r"""Update a content. Only supports full resource update.
@@ -710,7 +711,7 @@ def delete_content(
710711
*,
711712
name: Optional[str] = None,
712713
retry: OptionalRetry = gapic_v1.method.DEFAULT,
713-
timeout: Optional[float] = None,
714+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
714715
metadata: Sequence[Tuple[str, str]] = (),
715716
) -> None:
716717
r"""Delete a content.
@@ -799,7 +800,7 @@ def get_content(
799800
*,
800801
name: Optional[str] = None,
801802
retry: OptionalRetry = gapic_v1.method.DEFAULT,
802-
timeout: Optional[float] = None,
803+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
803804
metadata: Sequence[Tuple[str, str]] = (),
804805
) -> analyze.Content:
805806
r"""Get a content resource.
@@ -900,7 +901,7 @@ def get_iam_policy(
900901
*,
901902
resource: Optional[str] = None,
902903
retry: OptionalRetry = gapic_v1.method.DEFAULT,
903-
timeout: Optional[float] = None,
904+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
904905
metadata: Sequence[Tuple[str, str]] = (),
905906
) -> policy_pb2.Policy:
906907
r"""Gets the access control policy for a contentitem resource. A
@@ -1068,7 +1069,7 @@ def set_iam_policy(
10681069
request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None,
10691070
*,
10701071
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1071-
timeout: Optional[float] = None,
1072+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10721073
metadata: Sequence[Tuple[str, str]] = (),
10731074
) -> policy_pb2.Policy:
10741075
r"""Sets the access control policy on the specified contentitem
@@ -1214,7 +1215,7 @@ def test_iam_permissions(
12141215
request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
12151216
*,
12161217
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1217-
timeout: Optional[float] = None,
1218+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12181219
metadata: Sequence[Tuple[str, str]] = (),
12191220
) -> iam_policy_pb2.TestIamPermissionsResponse:
12201221
r"""Returns the caller's permissions on a resource. If the resource
@@ -1307,7 +1308,7 @@ def list_content(
13071308
*,
13081309
parent: Optional[str] = None,
13091310
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1310-
timeout: Optional[float] = None,
1311+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13111312
metadata: Sequence[Tuple[str, str]] = (),
13121313
) -> pagers.ListContentPager:
13131314
r"""List content.
@@ -1433,7 +1434,7 @@ def list_operations(
14331434
request: Optional[operations_pb2.ListOperationsRequest] = None,
14341435
*,
14351436
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1436-
timeout: Optional[float] = None,
1437+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14371438
metadata: Sequence[Tuple[str, str]] = (),
14381439
) -> operations_pb2.ListOperationsResponse:
14391440
r"""Lists operations that match the specified filter in the request.
@@ -1487,7 +1488,7 @@ def get_operation(
14871488
request: Optional[operations_pb2.GetOperationRequest] = None,
14881489
*,
14891490
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1490-
timeout: Optional[float] = None,
1491+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14911492
metadata: Sequence[Tuple[str, str]] = (),
14921493
) -> operations_pb2.Operation:
14931494
r"""Gets the latest state of a long-running operation.
@@ -1541,7 +1542,7 @@ def delete_operation(
15411542
request: Optional[operations_pb2.DeleteOperationRequest] = None,
15421543
*,
15431544
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1544-
timeout: Optional[float] = None,
1545+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15451546
metadata: Sequence[Tuple[str, str]] = (),
15461547
) -> None:
15471548
r"""Deletes a long-running operation.
@@ -1596,7 +1597,7 @@ def cancel_operation(
15961597
request: Optional[operations_pb2.CancelOperationRequest] = None,
15971598
*,
15981599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1599-
timeout: Optional[float] = None,
1600+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16001601
metadata: Sequence[Tuple[str, str]] = (),
16011602
) -> None:
16021603
r"""Starts asynchronous cancellation on a long-running operation.
@@ -1650,7 +1651,7 @@ def get_location(
16501651
request: Optional[locations_pb2.GetLocationRequest] = None,
16511652
*,
16521653
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1653-
timeout: Optional[float] = None,
1654+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16541655
metadata: Sequence[Tuple[str, str]] = (),
16551656
) -> locations_pb2.Location:
16561657
r"""Gets information about a location.
@@ -1704,7 +1705,7 @@ def list_locations(
17041705
request: Optional[locations_pb2.ListLocationsRequest] = None,
17051706
*,
17061707
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1707-
timeout: Optional[float] = None,
1708+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17081709
metadata: Sequence[Tuple[str, str]] = (),
17091710
) -> locations_pb2.ListLocationsResponse:
17101711
r"""Lists information about the supported locations for this service.
@@ -1754,14 +1755,9 @@ def list_locations(
17541755
return response
17551756

17561757

1757-
try:
1758-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1759-
gapic_version=pkg_resources.get_distribution(
1760-
"google-cloud-dataplex",
1761-
).version,
1762-
)
1763-
except pkg_resources.DistributionNotFound:
1764-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1758+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1759+
gapic_version=package_version.__version__
1760+
)
17651761

17661762

17671763
__all__ = ("ContentServiceClient",)

google/cloud/dataplex_v1/services/content_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@
2828
from google.longrunning import operations_pb2
2929
from google.oauth2 import service_account # type: ignore
3030
from google.protobuf import empty_pb2 # type: ignore
31-
import pkg_resources
3231

32+
from google.cloud.dataplex_v1 import gapic_version as package_version
3333
from google.cloud.dataplex_v1.types import analyze
3434
from google.cloud.dataplex_v1.types import content
3535
from google.cloud.dataplex_v1.types import content as gcd_content
3636

37-
try:
38-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
39-
gapic_version=pkg_resources.get_distribution(
40-
"google-cloud-dataplex",
41-
).version,
42-
)
43-
except pkg_resources.DistributionNotFound:
44-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
37+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
38+
gapic_version=package_version.__version__
39+
)
4540

4641

4742
class ContentServiceTransport(abc.ABC):

0 commit comments

Comments
 (0)