Skip to content

Commit e5875cb

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#708)
* 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: googleapis/googleapis-gen@387b734 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update release-please-config.json * drop pkg_resources * update the version in gapic_version.py * fix typo * lint Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent ec74260 commit e5875cb

File tree

14 files changed

+190
-196
lines changed

14 files changed

+190
-196
lines changed

google/cloud/bigtable/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@
1414

1515
"""Google Cloud Bigtable API package."""
1616

17-
from typing import Optional
18-
import pkg_resources
1917
from google.cloud.bigtable.client import Client
2018

19+
from google.cloud.bigtable import gapic_version as package_version
2120

22-
__version__: Optional[str]
23-
try:
24-
__version__ = pkg_resources.get_distribution("google-cloud-bigtable").version
25-
except pkg_resources.DistributionNotFound:
26-
__version__ = None
21+
__version__: str
2722

23+
__version__ = package_version.__version__
2824

2925
__all__ = ["__version__", "Client"]
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.14.0" # {x-release-please-version}

google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
Type,
2828
Union,
2929
)
30-
import pkg_resources
30+
31+
from google.cloud.bigtable_admin_v2 import gapic_version as package_version
3132

3233
from google.api_core.client_options import ClientOptions
3334
from google.api_core import exceptions as core_exceptions
@@ -255,7 +256,7 @@ async def create_instance(
255256
instance: Optional[gba_instance.Instance] = None,
256257
clusters: Optional[MutableMapping[str, gba_instance.Cluster]] = None,
257258
retry: OptionalRetry = gapic_v1.method.DEFAULT,
258-
timeout: Optional[float] = None,
259+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
259260
metadata: Sequence[Tuple[str, str]] = (),
260261
) -> operation_async.AsyncOperation:
261262
r"""Create an instance within a project.
@@ -386,7 +387,7 @@ async def get_instance(
386387
*,
387388
name: Optional[str] = None,
388389
retry: OptionalRetry = gapic_v1.method.DEFAULT,
389-
timeout: Optional[float] = None,
390+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
390391
metadata: Sequence[Tuple[str, str]] = (),
391392
) -> instance.Instance:
392393
r"""Gets information about an instance.
@@ -478,7 +479,7 @@ async def list_instances(
478479
*,
479480
parent: Optional[str] = None,
480481
retry: OptionalRetry = gapic_v1.method.DEFAULT,
481-
timeout: Optional[float] = None,
482+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
482483
metadata: Sequence[Tuple[str, str]] = (),
483484
) -> bigtable_instance_admin.ListInstancesResponse:
484485
r"""Lists information about instances in a project.
@@ -564,7 +565,7 @@ async def update_instance(
564565
request: Optional[Union[instance.Instance, dict]] = None,
565566
*,
566567
retry: OptionalRetry = gapic_v1.method.DEFAULT,
567-
timeout: Optional[float] = None,
568+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
568569
metadata: Sequence[Tuple[str, str]] = (),
569570
) -> instance.Instance:
570571
r"""Updates an instance within a project. This method
@@ -642,7 +643,7 @@ async def partial_update_instance(
642643
instance: Optional[gba_instance.Instance] = None,
643644
update_mask: Optional[field_mask_pb2.FieldMask] = None,
644645
retry: OptionalRetry = gapic_v1.method.DEFAULT,
645-
timeout: Optional[float] = None,
646+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
646647
metadata: Sequence[Tuple[str, str]] = (),
647648
) -> operation_async.AsyncOperation:
648649
r"""Partially updates an instance within a project. This
@@ -757,7 +758,7 @@ async def delete_instance(
757758
*,
758759
name: Optional[str] = None,
759760
retry: OptionalRetry = gapic_v1.method.DEFAULT,
760-
timeout: Optional[float] = None,
761+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
761762
metadata: Sequence[Tuple[str, str]] = (),
762763
) -> None:
763764
r"""Delete an instance from a project.
@@ -829,7 +830,7 @@ async def create_cluster(
829830
cluster_id: Optional[str] = None,
830831
cluster: Optional[instance.Cluster] = None,
831832
retry: OptionalRetry = gapic_v1.method.DEFAULT,
832-
timeout: Optional[float] = None,
833+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
833834
metadata: Sequence[Tuple[str, str]] = (),
834835
) -> operation_async.AsyncOperation:
835836
r"""Creates a cluster within an instance.
@@ -946,7 +947,7 @@ async def get_cluster(
946947
*,
947948
name: Optional[str] = None,
948949
retry: OptionalRetry = gapic_v1.method.DEFAULT,
949-
timeout: Optional[float] = None,
950+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
950951
metadata: Sequence[Tuple[str, str]] = (),
951952
) -> instance.Cluster:
952953
r"""Gets information about a cluster.
@@ -1037,7 +1038,7 @@ async def list_clusters(
10371038
*,
10381039
parent: Optional[str] = None,
10391040
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1040-
timeout: Optional[float] = None,
1041+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10411042
metadata: Sequence[Tuple[str, str]] = (),
10421043
) -> bigtable_instance_admin.ListClustersResponse:
10431044
r"""Lists information about clusters in an instance.
@@ -1125,7 +1126,7 @@ async def update_cluster(
11251126
request: Optional[Union[instance.Cluster, dict]] = None,
11261127
*,
11271128
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1128-
timeout: Optional[float] = None,
1129+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11291130
metadata: Sequence[Tuple[str, str]] = (),
11301131
) -> operation_async.AsyncOperation:
11311132
r"""Updates a cluster within an instance.
@@ -1211,7 +1212,7 @@ async def partial_update_cluster(
12111212
cluster: Optional[instance.Cluster] = None,
12121213
update_mask: Optional[field_mask_pb2.FieldMask] = None,
12131214
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1214-
timeout: Optional[float] = None,
1215+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12151216
metadata: Sequence[Tuple[str, str]] = (),
12161217
) -> operation_async.AsyncOperation:
12171218
r"""Partially updates a cluster within a project. This method is the
@@ -1325,7 +1326,7 @@ async def delete_cluster(
13251326
*,
13261327
name: Optional[str] = None,
13271328
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1328-
timeout: Optional[float] = None,
1329+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13291330
metadata: Sequence[Tuple[str, str]] = (),
13301331
) -> None:
13311332
r"""Deletes a cluster from an instance.
@@ -1397,7 +1398,7 @@ async def create_app_profile(
13971398
app_profile_id: Optional[str] = None,
13981399
app_profile: Optional[instance.AppProfile] = None,
13991400
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1400-
timeout: Optional[float] = None,
1401+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
14011402
metadata: Sequence[Tuple[str, str]] = (),
14021403
) -> instance.AppProfile:
14031404
r"""Creates an app profile within an instance.
@@ -1497,7 +1498,7 @@ async def get_app_profile(
14971498
*,
14981499
name: Optional[str] = None,
14991500
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1500-
timeout: Optional[float] = None,
1501+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15011502
metadata: Sequence[Tuple[str, str]] = (),
15021503
) -> instance.AppProfile:
15031504
r"""Gets information about an app profile.
@@ -1587,7 +1588,7 @@ async def list_app_profiles(
15871588
*,
15881589
parent: Optional[str] = None,
15891590
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1590-
timeout: Optional[float] = None,
1591+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15911592
metadata: Sequence[Tuple[str, str]] = (),
15921593
) -> pagers.ListAppProfilesAsyncPager:
15931594
r"""Lists information about app profiles in an instance.
@@ -1692,7 +1693,7 @@ async def update_app_profile(
16921693
app_profile: Optional[instance.AppProfile] = None,
16931694
update_mask: Optional[field_mask_pb2.FieldMask] = None,
16941695
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1695-
timeout: Optional[float] = None,
1696+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16961697
metadata: Sequence[Tuple[str, str]] = (),
16971698
) -> operation_async.AsyncOperation:
16981699
r"""Updates an app profile within an instance.
@@ -1802,7 +1803,7 @@ async def delete_app_profile(
18021803
*,
18031804
name: Optional[str] = None,
18041805
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1805-
timeout: Optional[float] = None,
1806+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18061807
metadata: Sequence[Tuple[str, str]] = (),
18071808
) -> None:
18081809
r"""Deletes an app profile from an instance.
@@ -1870,7 +1871,7 @@ async def get_iam_policy(
18701871
*,
18711872
resource: Optional[str] = None,
18721873
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1873-
timeout: Optional[float] = None,
1874+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18741875
metadata: Sequence[Tuple[str, str]] = (),
18751876
) -> policy_pb2.Policy:
18761877
r"""Gets the access control policy for an instance
@@ -2021,7 +2022,7 @@ async def set_iam_policy(
20212022
*,
20222023
resource: Optional[str] = None,
20232024
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2024-
timeout: Optional[float] = None,
2025+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20252026
metadata: Sequence[Tuple[str, str]] = (),
20262027
) -> policy_pb2.Policy:
20272028
r"""Sets the access control policy on an instance
@@ -2162,7 +2163,7 @@ async def test_iam_permissions(
21622163
resource: Optional[str] = None,
21632164
permissions: Optional[MutableSequence[str]] = None,
21642165
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2165-
timeout: Optional[float] = None,
2166+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21662167
metadata: Sequence[Tuple[str, str]] = (),
21672168
) -> iam_policy_pb2.TestIamPermissionsResponse:
21682169
r"""Returns permissions that the caller has on the
@@ -2263,7 +2264,7 @@ async def list_hot_tablets(
22632264
*,
22642265
parent: Optional[str] = None,
22652266
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2266-
timeout: Optional[float] = None,
2267+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
22672268
metadata: Sequence[Tuple[str, str]] = (),
22682269
) -> pagers.ListHotTabletsAsyncPager:
22692270
r"""Lists hot tablets in a cluster, within the time range
@@ -2364,14 +2365,9 @@ async def __aexit__(self, exc_type, exc, tb):
23642365
await self.transport.close()
23652366

23662367

2367-
try:
2368-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2369-
gapic_version=pkg_resources.get_distribution(
2370-
"google-cloud-bigtable-admin",
2371-
).version,
2372-
)
2373-
except pkg_resources.DistributionNotFound:
2374-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
2368+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
2369+
gapic_version=package_version.__version__
2370+
)
23752371

23762372

23772373
__all__ = ("BigtableInstanceAdminAsyncClient",)

0 commit comments

Comments
 (0)