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

Commit 3e1b599

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#94)
* 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 <[email protected]>
1 parent fd8cfa4 commit 3e1b599

File tree

10 files changed

+45
-46
lines changed

10 files changed

+45
-46
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

google/cloud/ids_v1/gapic_version.py

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

google/cloud/ids_v1/services/ids/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -214,7 +215,7 @@ async def list_endpoints(
214215
*,
215216
parent: Optional[str] = None,
216217
retry: OptionalRetry = gapic_v1.method.DEFAULT,
217-
timeout: Optional[float] = None,
218+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
218219
metadata: Sequence[Tuple[str, str]] = (),
219220
) -> pagers.ListEndpointsAsyncPager:
220221
r"""Lists Endpoints in a given project and location.
@@ -335,7 +336,7 @@ async def get_endpoint(
335336
*,
336337
name: Optional[str] = None,
337338
retry: OptionalRetry = gapic_v1.method.DEFAULT,
338-
timeout: Optional[float] = None,
339+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
339340
metadata: Sequence[Tuple[str, str]] = (),
340341
) -> ids.Endpoint:
341342
r"""Gets details of a single Endpoint.
@@ -449,7 +450,7 @@ async def create_endpoint(
449450
endpoint: Optional[ids.Endpoint] = None,
450451
endpoint_id: Optional[str] = None,
451452
retry: OptionalRetry = gapic_v1.method.DEFAULT,
452-
timeout: Optional[float] = None,
453+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
453454
metadata: Sequence[Tuple[str, str]] = (),
454455
) -> operation_async.AsyncOperation:
455456
r"""Creates a new Endpoint in a given project and
@@ -486,7 +487,7 @@ async def sample_create_endpoint():
486487
487488
print("Waiting for operation to complete...")
488489
489-
response = await operation.result()
490+
response = (await operation).result()
490491
491492
# Handle the response
492493
print(response)
@@ -589,7 +590,7 @@ async def delete_endpoint(
589590
*,
590591
name: Optional[str] = None,
591592
retry: OptionalRetry = gapic_v1.method.DEFAULT,
592-
timeout: Optional[float] = None,
593+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
593594
metadata: Sequence[Tuple[str, str]] = (),
594595
) -> operation_async.AsyncOperation:
595596
r"""Deletes a single Endpoint.
@@ -619,7 +620,7 @@ async def sample_delete_endpoint():
619620
620621
print("Waiting for operation to complete...")
621622
622-
response = await operation.result()
623+
response = (await operation).result()
623624
624625
# Handle the response
625626
print(response)
@@ -713,14 +714,9 @@ async def __aexit__(self, exc_type, exc, tb):
713714
await self.transport.close()
714715

715716

716-
try:
717-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
718-
gapic_version=pkg_resources.get_distribution(
719-
"google-cloud-ids",
720-
).version,
721-
)
722-
except pkg_resources.DistributionNotFound:
723-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
717+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
718+
gapic_version=package_version.__version__
719+
)
724720

725721

726722
__all__ = ("IDSAsyncClient",)

google/cloud/ids_v1/services/ids/client.py

Lines changed: 9 additions & 13 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.ids_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -449,7 +450,7 @@ def list_endpoints(
449450
*,
450451
parent: Optional[str] = None,
451452
retry: OptionalRetry = gapic_v1.method.DEFAULT,
452-
timeout: Optional[float] = None,
453+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
453454
metadata: Sequence[Tuple[str, str]] = (),
454455
) -> pagers.ListEndpointsPager:
455456
r"""Lists Endpoints in a given project and location.
@@ -561,7 +562,7 @@ def get_endpoint(
561562
*,
562563
name: Optional[str] = None,
563564
retry: OptionalRetry = gapic_v1.method.DEFAULT,
564-
timeout: Optional[float] = None,
565+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
565566
metadata: Sequence[Tuple[str, str]] = (),
566567
) -> ids.Endpoint:
567568
r"""Gets details of a single Endpoint.
@@ -666,7 +667,7 @@ def create_endpoint(
666667
endpoint: Optional[ids.Endpoint] = None,
667668
endpoint_id: Optional[str] = None,
668669
retry: OptionalRetry = gapic_v1.method.DEFAULT,
669-
timeout: Optional[float] = None,
670+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
670671
metadata: Sequence[Tuple[str, str]] = (),
671672
) -> operation.Operation:
672673
r"""Creates a new Endpoint in a given project and
@@ -806,7 +807,7 @@ def delete_endpoint(
806807
*,
807808
name: Optional[str] = None,
808809
retry: OptionalRetry = gapic_v1.method.DEFAULT,
809-
timeout: Optional[float] = None,
810+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
810811
metadata: Sequence[Tuple[str, str]] = (),
811812
) -> operation.Operation:
812813
r"""Deletes a single Endpoint.
@@ -937,14 +938,9 @@ def __exit__(self, type, value, traceback):
937938
self.transport.close()
938939

939940

940-
try:
941-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
942-
gapic_version=pkg_resources.get_distribution(
943-
"google-cloud-ids",
944-
).version,
945-
)
946-
except pkg_resources.DistributionNotFound:
947-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
941+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
942+
gapic_version=package_version.__version__
943+
)
948944

949945

950946
__all__ = ("IDSClient",)

google/cloud/ids_v1/services/ids/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.ids_v1 import gapic_version as package_version
2929
from google.cloud.ids_v1.types import ids
3030

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

4035

4136
class IDSTransport(abc.ABC):

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/ids/gapic_version.py",
8+
"google/cloud/ids_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.ids.v1.json",

samples/generated_samples/ids_v1_generated_ids_create_endpoint_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def sample_create_endpoint():
5454

5555
print("Waiting for operation to complete...")
5656

57-
response = await operation.result()
57+
response = (await operation).result()
5858

5959
# Handle the response
6060
print(response)

samples/generated_samples/ids_v1_generated_ids_delete_endpoint_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def sample_delete_endpoint():
4848

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

51-
response = await operation.result()
51+
response = (await operation).result()
5252

5353
# Handle the response
5454
print(response)

setup.py

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

3838
dependencies = [
39-
"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.*",
39+
"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.*",
4040
"proto-plus >= 1.22.0, <2.0.0dev",
4141
"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",
4242
]

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)