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

Commit 6db782b

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#156)
* 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 c0944f7 commit 6db782b

File tree

8 files changed

+47
-48
lines changed

8 files changed

+47
-48
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
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.3" # {x-release-please-version}

google/cloud/essential_contacts_v1/services/essential_contacts_service/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.essential_contacts_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -230,7 +231,7 @@ async def create_contact(
230231
parent: Optional[str] = None,
231232
contact: Optional[service.Contact] = None,
232233
retry: OptionalRetry = gapic_v1.method.DEFAULT,
233-
timeout: Optional[float] = None,
234+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
234235
metadata: Sequence[Tuple[str, str]] = (),
235236
) -> service.Contact:
236237
r"""Adds a new contact for a resource.
@@ -344,7 +345,7 @@ async def update_contact(
344345
contact: Optional[service.Contact] = None,
345346
update_mask: Optional[field_mask_pb2.FieldMask] = None,
346347
retry: OptionalRetry = gapic_v1.method.DEFAULT,
347-
timeout: Optional[float] = None,
348+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
348349
metadata: Sequence[Tuple[str, str]] = (),
349350
) -> service.Contact:
350351
r"""Updates a contact.
@@ -460,7 +461,7 @@ async def list_contacts(
460461
*,
461462
parent: Optional[str] = None,
462463
retry: OptionalRetry = gapic_v1.method.DEFAULT,
463-
timeout: Optional[float] = None,
464+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
464465
metadata: Sequence[Tuple[str, str]] = (),
465466
) -> pagers.ListContactsAsyncPager:
466467
r"""Lists the contacts that have been set on a resource.
@@ -585,7 +586,7 @@ async def get_contact(
585586
*,
586587
name: Optional[str] = None,
587588
retry: OptionalRetry = gapic_v1.method.DEFAULT,
588-
timeout: Optional[float] = None,
589+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
589590
metadata: Sequence[Tuple[str, str]] = (),
590591
) -> service.Contact:
591592
r"""Gets a single contact.
@@ -698,7 +699,7 @@ async def delete_contact(
698699
*,
699700
name: Optional[str] = None,
700701
retry: OptionalRetry = gapic_v1.method.DEFAULT,
701-
timeout: Optional[float] = None,
702+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
702703
metadata: Sequence[Tuple[str, str]] = (),
703704
) -> None:
704705
r"""Deletes a contact.
@@ -789,7 +790,7 @@ async def compute_contacts(
789790
request: Optional[Union[service.ComputeContactsRequest, dict]] = None,
790791
*,
791792
retry: OptionalRetry = gapic_v1.method.DEFAULT,
792-
timeout: Optional[float] = None,
793+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
793794
metadata: Sequence[Tuple[str, str]] = (),
794795
) -> pagers.ComputeContactsAsyncPager:
795796
r"""Lists all contacts for the resource that are
@@ -884,7 +885,7 @@ async def send_test_message(
884885
request: Optional[Union[service.SendTestMessageRequest, dict]] = None,
885886
*,
886887
retry: OptionalRetry = gapic_v1.method.DEFAULT,
887-
timeout: Optional[float] = None,
888+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
888889
metadata: Sequence[Tuple[str, str]] = (),
889890
) -> None:
890891
r"""Allows a contact admin to send a test message to
@@ -957,14 +958,9 @@ async def __aexit__(self, exc_type, exc, tb):
957958
await self.transport.close()
958959

959960

960-
try:
961-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
962-
gapic_version=pkg_resources.get_distribution(
963-
"google-cloud-essential-contacts",
964-
).version,
965-
)
966-
except pkg_resources.DistributionNotFound:
967-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
961+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
962+
gapic_version=package_version.__version__
963+
)
968964

969965

970966
__all__ = ("EssentialContactsServiceAsyncClient",)

google/cloud/essential_contacts_v1/services/essential_contacts_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -447,7 +448,7 @@ def create_contact(
447448
parent: Optional[str] = None,
448449
contact: Optional[service.Contact] = None,
449450
retry: OptionalRetry = gapic_v1.method.DEFAULT,
450-
timeout: Optional[float] = None,
451+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
451452
metadata: Sequence[Tuple[str, str]] = (),
452453
) -> service.Contact:
453454
r"""Adds a new contact for a resource.
@@ -561,7 +562,7 @@ def update_contact(
561562
contact: Optional[service.Contact] = None,
562563
update_mask: Optional[field_mask_pb2.FieldMask] = 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
) -> service.Contact:
567568
r"""Updates a contact.
@@ -677,7 +678,7 @@ def list_contacts(
677678
*,
678679
parent: Optional[str] = None,
679680
retry: OptionalRetry = gapic_v1.method.DEFAULT,
680-
timeout: Optional[float] = None,
681+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
681682
metadata: Sequence[Tuple[str, str]] = (),
682683
) -> pagers.ListContactsPager:
683684
r"""Lists the contacts that have been set on a resource.
@@ -793,7 +794,7 @@ def get_contact(
793794
*,
794795
name: Optional[str] = None,
795796
retry: OptionalRetry = gapic_v1.method.DEFAULT,
796-
timeout: Optional[float] = None,
797+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
797798
metadata: Sequence[Tuple[str, str]] = (),
798799
) -> service.Contact:
799800
r"""Gets a single contact.
@@ -897,7 +898,7 @@ def delete_contact(
897898
*,
898899
name: Optional[str] = None,
899900
retry: OptionalRetry = gapic_v1.method.DEFAULT,
900-
timeout: Optional[float] = None,
901+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
901902
metadata: Sequence[Tuple[str, str]] = (),
902903
) -> None:
903904
r"""Deletes a contact.
@@ -988,7 +989,7 @@ def compute_contacts(
988989
request: Optional[Union[service.ComputeContactsRequest, dict]] = None,
989990
*,
990991
retry: OptionalRetry = gapic_v1.method.DEFAULT,
991-
timeout: Optional[float] = None,
992+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
992993
metadata: Sequence[Tuple[str, str]] = (),
993994
) -> pagers.ComputeContactsPager:
994995
r"""Lists all contacts for the resource that are
@@ -1084,7 +1085,7 @@ def send_test_message(
10841085
request: Optional[Union[service.SendTestMessageRequest, dict]] = None,
10851086
*,
10861087
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1087-
timeout: Optional[float] = None,
1088+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10881089
metadata: Sequence[Tuple[str, str]] = (),
10891090
) -> None:
10901091
r"""Allows a contact admin to send a test message to
@@ -1165,14 +1166,9 @@ def __exit__(self, type, value, traceback):
11651166
self.transport.close()
11661167

11671168

1168-
try:
1169-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1170-
gapic_version=pkg_resources.get_distribution(
1171-
"google-cloud-essential-contacts",
1172-
).version,
1173-
)
1174-
except pkg_resources.DistributionNotFound:
1175-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1169+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1170+
gapic_version=package_version.__version__
1171+
)
11761172

11771173

11781174
__all__ = ("EssentialContactsServiceClient",)

google/cloud/essential_contacts_v1/services/essential_contacts_service/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.oauth2 import service_account # type: ignore
2626
from google.protobuf import empty_pb2 # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.essential_contacts_v1 import gapic_version as package_version
2929
from google.cloud.essential_contacts_v1.types import service
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-essential-contacts",
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 EssentialContactsServiceTransport(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/essential_contacts/gapic_version.py",
8+
"google/cloud/essential_contacts_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.essentialcontacts.v1.json",

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)