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

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#372)
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

* 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>
  • Loading branch information
3 people committed Dec 7, 2022
1 parent 90e48b0 commit 12a72b6
Show file tree
Hide file tree
Showing 179 changed files with 1,821 additions and 2,592 deletions.
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
16 changes: 16 additions & 0 deletions google/cloud/compute_v1/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__ = "1.6.1" # {x-release-please-version}
20 changes: 8 additions & 12 deletions google/cloud/compute_v1/services/accelerator_types/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -429,7 +430,7 @@ def aggregated_list(
*,
project: 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.AggregatedListPager:
r"""Retrieves an aggregated list of accelerator types.
Expand Down Expand Up @@ -516,7 +517,7 @@ def get(
zone: Optional[str] = None,
accelerator_type: 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]] = (),
) -> compute.AcceleratorType:
r"""Returns the specified accelerator type.
Expand Down Expand Up @@ -622,7 +623,7 @@ def list(
project: Optional[str] = None,
zone: 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.ListPager:
r"""Retrieves a list of accelerator types that are
Expand Down Expand Up @@ -731,14 +732,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__ = ("AcceleratorTypesClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version
from google.cloud.compute_v1.types import compute

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__
)


class AcceleratorTypesTransport(abc.ABC):
Expand Down
32 changes: 14 additions & 18 deletions google/cloud/compute_v1/services/addresses/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -426,7 +427,7 @@ def aggregated_list(
*,
project: 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.AggregatedListPager:
r"""Retrieves an aggregated list of addresses.
Expand Down Expand Up @@ -513,7 +514,7 @@ def delete_unary(
region: Optional[str] = None,
address: 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]] = (),
) -> compute.Operation:
r"""Deletes the specified address resource.
Expand Down Expand Up @@ -612,7 +613,7 @@ def delete(
region: Optional[str] = None,
address: 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]] = (),
) -> extended_operation.ExtendedOperation:
r"""Deletes the specified address resource.
Expand Down Expand Up @@ -736,7 +737,7 @@ def get(
region: Optional[str] = None,
address: 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]] = (),
) -> compute.Address:
r"""Returns the specified address resource.
Expand Down Expand Up @@ -839,7 +840,7 @@ def insert_unary(
region: Optional[str] = None,
address_resource: Optional[compute.Address] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> compute.Operation:
r"""Creates an address resource in the specified project
Expand Down Expand Up @@ -936,7 +937,7 @@ def insert(
region: Optional[str] = None,
address_resource: Optional[compute.Address] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> extended_operation.ExtendedOperation:
r"""Creates an address resource in the specified project
Expand Down Expand Up @@ -1057,7 +1058,7 @@ def list(
project: Optional[str] = None,
region: 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.ListPager:
r"""Retrieves a list of addresses contained within the
Expand Down Expand Up @@ -1160,7 +1161,7 @@ def set_labels_unary(
compute.RegionSetLabelsRequest
] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> compute.Operation:
r"""Sets the labels on an Address. To learn more about
Expand Down Expand Up @@ -1274,7 +1275,7 @@ def set_labels(
compute.RegionSetLabelsRequest
] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> extended_operation.ExtendedOperation:
r"""Sets the labels on an Address. To learn more about
Expand Down Expand Up @@ -1416,14 +1417,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__ = ("AddressesClient",)
13 changes: 4 additions & 9 deletions google/cloud/compute_v1/services/addresses/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,14 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version
from google.cloud.compute_v1.services import region_operations
from google.cloud.compute_v1.types import compute

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__
)


class AddressesTransport(abc.ABC):
Expand Down
36 changes: 16 additions & 20 deletions google/cloud/compute_v1/services/autoscalers/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -426,7 +427,7 @@ def aggregated_list(
*,
project: 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.AggregatedListPager:
r"""Retrieves an aggregated list of autoscalers.
Expand Down Expand Up @@ -513,7 +514,7 @@ def delete_unary(
zone: Optional[str] = None,
autoscaler: 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]] = (),
) -> compute.Operation:
r"""Deletes the specified autoscaler.
Expand Down Expand Up @@ -610,7 +611,7 @@ def delete(
zone: Optional[str] = None,
autoscaler: 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]] = (),
) -> extended_operation.ExtendedOperation:
r"""Deletes the specified autoscaler.
Expand Down Expand Up @@ -732,7 +733,7 @@ def get(
zone: Optional[str] = None,
autoscaler: 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]] = (),
) -> compute.Autoscaler:
r"""Returns the specified autoscaler resource. Gets a
Expand Down Expand Up @@ -839,7 +840,7 @@ def insert_unary(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> compute.Operation:
r"""Creates an autoscaler in the specified project using
Expand Down Expand Up @@ -936,7 +937,7 @@ def insert(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> extended_operation.ExtendedOperation:
r"""Creates an autoscaler in the specified project using
Expand Down Expand Up @@ -1057,7 +1058,7 @@ def list(
project: Optional[str] = None,
zone: 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.ListPager:
r"""Retrieves a list of autoscalers contained within the
Expand Down Expand Up @@ -1159,7 +1160,7 @@ def patch_unary(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> compute.Operation:
r"""Updates an autoscaler in the specified project using
Expand Down Expand Up @@ -1258,7 +1259,7 @@ def patch(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> extended_operation.ExtendedOperation:
r"""Updates an autoscaler in the specified project using
Expand Down Expand Up @@ -1382,7 +1383,7 @@ def update_unary(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> compute.Operation:
r"""Updates an autoscaler in the specified project using
Expand Down Expand Up @@ -1479,7 +1480,7 @@ def update(
zone: Optional[str] = None,
autoscaler_resource: Optional[compute.Autoscaler] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> extended_operation.ExtendedOperation:
r"""Updates an autoscaler in the specified project using
Expand Down Expand Up @@ -1607,14 +1608,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__ = ("AutoscalersClient",)
13 changes: 4 additions & 9 deletions google/cloud/compute_v1/services/autoscalers/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,14 @@
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.compute_v1 import gapic_version as package_version
from google.cloud.compute_v1.services import zone_operations
from google.cloud.compute_v1.types import compute

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-compute",
).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__
)


class AutoscalersTransport(abc.ABC):
Expand Down
Loading

0 comments on commit 12a72b6

Please sign in to comment.