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

Commit 94cf595

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#154)
* 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 24798d4 commit 94cf595

10 files changed

Lines changed: 48 additions & 48 deletions

File tree

.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__ = "0.7.2" # {x-release-please-version}

google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/async_client.py

Lines changed: 12 additions & 16 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.lifesciences_v2beta import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def run_pipeline(
225226
request: Optional[Union[workflows.RunPipelineRequest, dict]] = None,
226227
*,
227228
retry: OptionalRetry = gapic_v1.method.DEFAULT,
228-
timeout: Optional[float] = None,
229+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
229230
metadata: Sequence[Tuple[str, str]] = (),
230231
) -> operation_async.AsyncOperation:
231232
r"""Runs a pipeline. The returned Operation's [metadata]
@@ -271,7 +272,7 @@ async def sample_run_pipeline():
271272
272273
print("Waiting for operation to complete...")
273274
274-
response = await operation.result()
275+
response = (await operation).result()
275276
276277
# Handle the response
277278
print(response)
@@ -337,7 +338,7 @@ async def list_operations(
337338
request: Optional[operations_pb2.ListOperationsRequest] = None,
338339
*,
339340
retry: OptionalRetry = gapic_v1.method.DEFAULT,
340-
timeout: Optional[float] = None,
341+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
341342
metadata: Sequence[Tuple[str, str]] = (),
342343
) -> operations_pb2.ListOperationsResponse:
343344
r"""Lists operations that match the specified filter in the request.
@@ -391,7 +392,7 @@ async def get_operation(
391392
request: Optional[operations_pb2.GetOperationRequest] = None,
392393
*,
393394
retry: OptionalRetry = gapic_v1.method.DEFAULT,
394-
timeout: Optional[float] = None,
395+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
395396
metadata: Sequence[Tuple[str, str]] = (),
396397
) -> operations_pb2.Operation:
397398
r"""Gets the latest state of a long-running operation.
@@ -445,7 +446,7 @@ async def cancel_operation(
445446
request: Optional[operations_pb2.CancelOperationRequest] = None,
446447
*,
447448
retry: OptionalRetry = gapic_v1.method.DEFAULT,
448-
timeout: Optional[float] = None,
449+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
449450
metadata: Sequence[Tuple[str, str]] = (),
450451
) -> None:
451452
r"""Starts asynchronous cancellation on a long-running operation.
@@ -499,7 +500,7 @@ async def get_location(
499500
request: Optional[locations_pb2.GetLocationRequest] = None,
500501
*,
501502
retry: OptionalRetry = gapic_v1.method.DEFAULT,
502-
timeout: Optional[float] = None,
503+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
503504
metadata: Sequence[Tuple[str, str]] = (),
504505
) -> locations_pb2.Location:
505506
r"""Gets information about a location.
@@ -553,7 +554,7 @@ async def list_locations(
553554
request: Optional[locations_pb2.ListLocationsRequest] = None,
554555
*,
555556
retry: OptionalRetry = gapic_v1.method.DEFAULT,
556-
timeout: Optional[float] = None,
557+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
557558
metadata: Sequence[Tuple[str, str]] = (),
558559
) -> locations_pb2.ListLocationsResponse:
559560
r"""Lists information about the supported locations for this service.
@@ -609,14 +610,9 @@ async def __aexit__(self, exc_type, exc, tb):
609610
await self.transport.close()
610611

611612

612-
try:
613-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
614-
gapic_version=pkg_resources.get_distribution(
615-
"google-cloud-life-sciences",
616-
).version,
617-
)
618-
except pkg_resources.DistributionNotFound:
619-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
613+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
614+
gapic_version=package_version.__version__
615+
)
620616

621617

622618
__all__ = ("WorkflowsServiceV2BetaAsyncClient",)

google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/client.py

Lines changed: 11 additions & 15 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.lifesciences_v2beta import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -431,7 +432,7 @@ def run_pipeline(
431432
request: Optional[Union[workflows.RunPipelineRequest, dict]] = None,
432433
*,
433434
retry: OptionalRetry = gapic_v1.method.DEFAULT,
434-
timeout: Optional[float] = None,
435+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
435436
metadata: Sequence[Tuple[str, str]] = (),
436437
) -> operation.Operation:
437438
r"""Runs a pipeline. The returned Operation's [metadata]
@@ -557,7 +558,7 @@ def list_operations(
557558
request: Optional[operations_pb2.ListOperationsRequest] = None,
558559
*,
559560
retry: OptionalRetry = gapic_v1.method.DEFAULT,
560-
timeout: Optional[float] = None,
561+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
561562
metadata: Sequence[Tuple[str, str]] = (),
562563
) -> operations_pb2.ListOperationsResponse:
563564
r"""Lists operations that match the specified filter in the request.
@@ -611,7 +612,7 @@ def get_operation(
611612
request: Optional[operations_pb2.GetOperationRequest] = None,
612613
*,
613614
retry: OptionalRetry = gapic_v1.method.DEFAULT,
614-
timeout: Optional[float] = None,
615+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
615616
metadata: Sequence[Tuple[str, str]] = (),
616617
) -> operations_pb2.Operation:
617618
r"""Gets the latest state of a long-running operation.
@@ -665,7 +666,7 @@ def cancel_operation(
665666
request: Optional[operations_pb2.CancelOperationRequest] = None,
666667
*,
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
) -> None:
671672
r"""Starts asynchronous cancellation on a long-running operation.
@@ -719,7 +720,7 @@ def get_location(
719720
request: Optional[locations_pb2.GetLocationRequest] = None,
720721
*,
721722
retry: OptionalRetry = gapic_v1.method.DEFAULT,
722-
timeout: Optional[float] = None,
723+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
723724
metadata: Sequence[Tuple[str, str]] = (),
724725
) -> locations_pb2.Location:
725726
r"""Gets information about a location.
@@ -773,7 +774,7 @@ def list_locations(
773774
request: Optional[locations_pb2.ListLocationsRequest] = None,
774775
*,
775776
retry: OptionalRetry = gapic_v1.method.DEFAULT,
776-
timeout: Optional[float] = None,
777+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
777778
metadata: Sequence[Tuple[str, str]] = (),
778779
) -> locations_pb2.ListLocationsResponse:
779780
r"""Lists information about the supported locations for this service.
@@ -823,14 +824,9 @@ def list_locations(
823824
return response
824825

825826

826-
try:
827-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
828-
gapic_version=pkg_resources.get_distribution(
829-
"google-cloud-life-sciences",
830-
).version,
831-
)
832-
except pkg_resources.DistributionNotFound:
833-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
827+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
828+
gapic_version=package_version.__version__
829+
)
834830

835831

836832
__all__ = ("WorkflowsServiceV2BetaClient",)

google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@
2525
from google.cloud.location import locations_pb2 # type: ignore
2626
from google.longrunning import operations_pb2 # type: ignore
2727
from google.oauth2 import service_account # type: ignore
28-
import pkg_resources
2928

29+
from google.cloud.lifesciences_v2beta import gapic_version as package_version
3030
from google.cloud.lifesciences_v2beta.types import workflows
3131

32-
try:
33-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
34-
gapic_version=pkg_resources.get_distribution(
35-
"google-cloud-life-sciences",
36-
).version,
37-
)
38-
except pkg_resources.DistributionNotFound:
39-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
32+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33+
gapic_version=package_version.__version__
34+
)
4035

4136

4237
class WorkflowsServiceV2BetaTransport(abc.ABC):

google/cloud/lifesciences_v2beta/services/workflows_service_v2_beta/transports/rest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
362362
credentials=self._credentials,
363363
scopes=self._scopes,
364364
http_options=http_options,
365+
path_prefix="v2beta",
365366
)
366367

367368
self._operations_client = operations_v1.AbstractOperationsClient(

release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"release-type": "python",
66
"extra-files": [
77
"google/cloud/lifesciences/gapic_version.py",
8+
"google/cloud/lifesciences_v2beta/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.lifesciences.v2beta.json",

samples/generated_samples/lifesciences_v2beta_generated_workflows_service_v2_beta_run_pipeline_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async def sample_run_pipeline():
4747

4848
print("Waiting for operation to complete...")
4949

50-
response = await operation.result()
50+
response = (await operation).result()
5151

5252
# Handle the response
5353
print(response)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
release_status = "Development Status :: 5 - Production/Stable"
3939

4040
dependencies = [
41-
"google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
41+
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
4242
"proto-plus >= 1.22.0, <2.0.0dev",
4343
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
4444
]

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Pin the version to the lower bound.
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
7-
google-api-core==1.33.2
7+
google-api-core==1.34.0
88
proto-plus==1.22.0
99
protobuf==3.19.5

0 commit comments

Comments
 (0)