Skip to content

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#708)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people committed Dec 6, 2022
1 parent ec74260 commit e5875cb
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 196 deletions.
10 changes: 3 additions & 7 deletions google/cloud/bigtable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@

"""Google Cloud Bigtable API package."""

from typing import Optional
import pkg_resources
from google.cloud.bigtable.client import Client

from google.cloud.bigtable import gapic_version as package_version

__version__: Optional[str]
try:
__version__ = pkg_resources.get_distribution("google-cloud-bigtable").version
except pkg_resources.DistributionNotFound:
__version__ = None
__version__: str

__version__ = package_version.__version__

__all__ = ["__version__", "Client"]
16 changes: 16 additions & 0 deletions google/cloud/bigtable_admin_v2/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.14.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
Type,
Union,
)
import pkg_resources

from google.cloud.bigtable_admin_v2 import gapic_version as package_version

from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -255,7 +256,7 @@ async def create_instance(
instance: Optional[gba_instance.Instance] = None,
clusters: Optional[MutableMapping[str, gba_instance.Cluster]] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Create an instance within a project.
Expand Down Expand Up @@ -386,7 +387,7 @@ async def get_instance(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> instance.Instance:
r"""Gets information about an instance.
Expand Down Expand Up @@ -478,7 +479,7 @@ async def list_instances(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> bigtable_instance_admin.ListInstancesResponse:
r"""Lists information about instances in a project.
Expand Down Expand Up @@ -564,7 +565,7 @@ async def update_instance(
request: Optional[Union[instance.Instance, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> instance.Instance:
r"""Updates an instance within a project. This method
Expand Down Expand Up @@ -642,7 +643,7 @@ async def partial_update_instance(
instance: Optional[gba_instance.Instance] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Partially updates an instance within a project. This
Expand Down Expand Up @@ -757,7 +758,7 @@ async def delete_instance(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Delete an instance from a project.
Expand Down Expand Up @@ -829,7 +830,7 @@ async def create_cluster(
cluster_id: Optional[str] = None,
cluster: Optional[instance.Cluster] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Creates a cluster within an instance.
Expand Down Expand Up @@ -946,7 +947,7 @@ async def get_cluster(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> instance.Cluster:
r"""Gets information about a cluster.
Expand Down Expand Up @@ -1037,7 +1038,7 @@ async def list_clusters(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> bigtable_instance_admin.ListClustersResponse:
r"""Lists information about clusters in an instance.
Expand Down Expand Up @@ -1125,7 +1126,7 @@ async def update_cluster(
request: Optional[Union[instance.Cluster, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates a cluster within an instance.
Expand Down Expand Up @@ -1211,7 +1212,7 @@ async def partial_update_cluster(
cluster: Optional[instance.Cluster] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Partially updates a cluster within a project. This method is the
Expand Down Expand Up @@ -1325,7 +1326,7 @@ async def delete_cluster(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a cluster from an instance.
Expand Down Expand Up @@ -1397,7 +1398,7 @@ async def create_app_profile(
app_profile_id: Optional[str] = None,
app_profile: Optional[instance.AppProfile] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> instance.AppProfile:
r"""Creates an app profile within an instance.
Expand Down Expand Up @@ -1497,7 +1498,7 @@ async def get_app_profile(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> instance.AppProfile:
r"""Gets information about an app profile.
Expand Down Expand Up @@ -1587,7 +1588,7 @@ async def list_app_profiles(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListAppProfilesAsyncPager:
r"""Lists information about app profiles in an instance.
Expand Down Expand Up @@ -1692,7 +1693,7 @@ async def update_app_profile(
app_profile: Optional[instance.AppProfile] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates an app profile within an instance.
Expand Down Expand Up @@ -1802,7 +1803,7 @@ async def delete_app_profile(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes an app profile from an instance.
Expand Down Expand Up @@ -1870,7 +1871,7 @@ async def get_iam_policy(
*,
resource: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
r"""Gets the access control policy for an instance
Expand Down Expand Up @@ -2021,7 +2022,7 @@ async def set_iam_policy(
*,
resource: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
r"""Sets the access control policy on an instance
Expand Down Expand Up @@ -2162,7 +2163,7 @@ async def test_iam_permissions(
resource: Optional[str] = None,
permissions: Optional[MutableSequence[str]] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> iam_policy_pb2.TestIamPermissionsResponse:
r"""Returns permissions that the caller has on the
Expand Down Expand Up @@ -2263,7 +2264,7 @@ async def list_hot_tablets(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListHotTabletsAsyncPager:
r"""Lists hot tablets in a cluster, within the time range
Expand Down Expand Up @@ -2364,14 +2365,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-bigtable-admin",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("BigtableInstanceAdminAsyncClient",)

0 comments on commit e5875cb

Please sign in to comment.