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

Commit a086ce0

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#212)
* 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 0bd3738 commit a086ce0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+226
-318
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.7.0" # {x-release-please-version}

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -217,7 +218,7 @@ async def get_application(
217218
*,
218219
name: Optional[str] = None,
219220
retry: OptionalRetry = gapic_v1.method.DEFAULT,
220-
timeout: Optional[float] = None,
221+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
221222
metadata: Sequence[Tuple[str, str]] = (),
222223
) -> application.Application:
223224
r"""Gets information about an application.
@@ -318,7 +319,7 @@ async def create_application(
318319
request: Optional[Union[appengine.CreateApplicationRequest, dict]] = None,
319320
*,
320321
retry: OptionalRetry = gapic_v1.method.DEFAULT,
321-
timeout: Optional[float] = None,
322+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
322323
metadata: Sequence[Tuple[str, str]] = (),
323324
) -> operation_async.AsyncOperation:
324325
r"""Creates an App Engine application for a Google Cloud Platform
@@ -357,7 +358,7 @@ async def sample_create_application():
357358
358359
print("Waiting for operation to complete...")
359360
360-
response = await operation.result()
361+
response = (await operation).result()
361362
362363
# Handle the response
363364
print(response)
@@ -415,7 +416,7 @@ async def update_application(
415416
request: Optional[Union[appengine.UpdateApplicationRequest, dict]] = None,
416417
*,
417418
retry: OptionalRetry = gapic_v1.method.DEFAULT,
418-
timeout: Optional[float] = None,
419+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
419420
metadata: Sequence[Tuple[str, str]] = (),
420421
) -> operation_async.AsyncOperation:
421422
r"""Updates the specified Application resource. You can update the
@@ -452,7 +453,7 @@ async def sample_update_application():
452453
453454
print("Waiting for operation to complete...")
454455
455-
response = await operation.result()
456+
response = (await operation).result()
456457
457458
# Handle the response
458459
print(response)
@@ -516,7 +517,7 @@ async def repair_application(
516517
request: Optional[Union[appengine.RepairApplicationRequest, dict]] = None,
517518
*,
518519
retry: OptionalRetry = gapic_v1.method.DEFAULT,
519-
timeout: Optional[float] = None,
520+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
520521
metadata: Sequence[Tuple[str, str]] = (),
521522
) -> operation_async.AsyncOperation:
522523
r"""Recreates the required App Engine features for the specified App
@@ -555,7 +556,7 @@ async def sample_repair_application():
555556
556557
print("Waiting for operation to complete...")
557558
558-
response = await operation.result()
559+
response = (await operation).result()
559560
560561
# Handle the response
561562
print(response)
@@ -621,14 +622,9 @@ async def __aexit__(self, exc_type, exc, tb):
621622
await self.transport.close()
622623

623624

624-
try:
625-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
626-
gapic_version=pkg_resources.get_distribution(
627-
"google-cloud-appengine-admin",
628-
).version,
629-
)
630-
except pkg_resources.DistributionNotFound:
631-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
625+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
626+
gapic_version=package_version.__version__
627+
)
632628

633629

634630
__all__ = ("ApplicationsAsyncClient",)

google/cloud/appengine_admin_v1/services/applications/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.appengine_admin_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -426,7 +427,7 @@ def get_application(
426427
*,
427428
name: Optional[str] = None,
428429
retry: OptionalRetry = gapic_v1.method.DEFAULT,
429-
timeout: Optional[float] = None,
430+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
430431
metadata: Sequence[Tuple[str, str]] = (),
431432
) -> application.Application:
432433
r"""Gets information about an application.
@@ -527,7 +528,7 @@ def create_application(
527528
request: Optional[Union[appengine.CreateApplicationRequest, dict]] = None,
528529
*,
529530
retry: OptionalRetry = gapic_v1.method.DEFAULT,
530-
timeout: Optional[float] = None,
531+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
531532
metadata: Sequence[Tuple[str, str]] = (),
532533
) -> gac_operation.Operation:
533534
r"""Creates an App Engine application for a Google Cloud Platform
@@ -625,7 +626,7 @@ def update_application(
625626
request: Optional[Union[appengine.UpdateApplicationRequest, dict]] = None,
626627
*,
627628
retry: OptionalRetry = gapic_v1.method.DEFAULT,
628-
timeout: Optional[float] = None,
629+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
629630
metadata: Sequence[Tuple[str, str]] = (),
630631
) -> gac_operation.Operation:
631632
r"""Updates the specified Application resource. You can update the
@@ -727,7 +728,7 @@ def repair_application(
727728
request: Optional[Union[appengine.RepairApplicationRequest, dict]] = None,
728729
*,
729730
retry: OptionalRetry = gapic_v1.method.DEFAULT,
730-
timeout: Optional[float] = None,
731+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
731732
metadata: Sequence[Tuple[str, str]] = (),
732733
) -> gac_operation.Operation:
733734
r"""Recreates the required App Engine features for the specified App
@@ -840,14 +841,9 @@ def __exit__(self, type, value, traceback):
840841
self.transport.close()
841842

842843

843-
try:
844-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
845-
gapic_version=pkg_resources.get_distribution(
846-
"google-cloud-appengine-admin",
847-
).version,
848-
)
849-
except pkg_resources.DistributionNotFound:
850-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
844+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
845+
gapic_version=package_version.__version__
846+
)
851847

852848

853849
__all__ = ("ApplicationsClient",)

google/cloud/appengine_admin_v1/services/applications/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.appengine_admin_v1 import gapic_version as package_version
2929
from google.cloud.appengine_admin_v1.types import appengine, application
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-appengine-admin",
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 ApplicationsTransport(abc.ABC):

google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py

Lines changed: 10 additions & 14 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.appengine_admin_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -226,7 +227,7 @@ async def list_authorized_certificates(
226227
] = None,
227228
*,
228229
retry: OptionalRetry = gapic_v1.method.DEFAULT,
229-
timeout: Optional[float] = None,
230+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
230231
metadata: Sequence[Tuple[str, str]] = (),
231232
) -> pagers.ListAuthorizedCertificatesAsyncPager:
232233
r"""Lists all SSL certificates the user is authorized to
@@ -321,7 +322,7 @@ async def get_authorized_certificate(
321322
] = None,
322323
*,
323324
retry: OptionalRetry = gapic_v1.method.DEFAULT,
324-
timeout: Optional[float] = None,
325+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
325326
metadata: Sequence[Tuple[str, str]] = (),
326327
) -> certificate.AuthorizedCertificate:
327328
r"""Gets the specified SSL certificate.
@@ -405,7 +406,7 @@ async def create_authorized_certificate(
405406
] = None,
406407
*,
407408
retry: OptionalRetry = gapic_v1.method.DEFAULT,
408-
timeout: Optional[float] = None,
409+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
409410
metadata: Sequence[Tuple[str, str]] = (),
410411
) -> certificate.AuthorizedCertificate:
411412
r"""Uploads the specified SSL certificate.
@@ -489,7 +490,7 @@ async def update_authorized_certificate(
489490
] = None,
490491
*,
491492
retry: OptionalRetry = gapic_v1.method.DEFAULT,
492-
timeout: Optional[float] = None,
493+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
493494
metadata: Sequence[Tuple[str, str]] = (),
494495
) -> certificate.AuthorizedCertificate:
495496
r"""Updates the specified SSL certificate. To renew a certificate
@@ -578,7 +579,7 @@ async def delete_authorized_certificate(
578579
] = None,
579580
*,
580581
retry: OptionalRetry = gapic_v1.method.DEFAULT,
581-
timeout: Optional[float] = None,
582+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
582583
metadata: Sequence[Tuple[str, str]] = (),
583584
) -> None:
584585
r"""Deletes the specified SSL certificate.
@@ -647,14 +648,9 @@ async def __aexit__(self, exc_type, exc, tb):
647648
await self.transport.close()
648649

649650

650-
try:
651-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
652-
gapic_version=pkg_resources.get_distribution(
653-
"google-cloud-appengine-admin",
654-
).version,
655-
)
656-
except pkg_resources.DistributionNotFound:
657-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
651+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
652+
gapic_version=package_version.__version__
653+
)
658654

659655

660656
__all__ = ("AuthorizedCertificatesAsyncClient",)

google/cloud/appengine_admin_v1/services/authorized_certificates/client.py

Lines changed: 10 additions & 14 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.appengine_admin_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -430,7 +431,7 @@ def list_authorized_certificates(
430431
] = None,
431432
*,
432433
retry: OptionalRetry = gapic_v1.method.DEFAULT,
433-
timeout: Optional[float] = None,
434+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
434435
metadata: Sequence[Tuple[str, str]] = (),
435436
) -> pagers.ListAuthorizedCertificatesPager:
436437
r"""Lists all SSL certificates the user is authorized to
@@ -528,7 +529,7 @@ def get_authorized_certificate(
528529
] = None,
529530
*,
530531
retry: OptionalRetry = gapic_v1.method.DEFAULT,
531-
timeout: Optional[float] = None,
532+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
532533
metadata: Sequence[Tuple[str, str]] = (),
533534
) -> certificate.AuthorizedCertificate:
534535
r"""Gets the specified SSL certificate.
@@ -615,7 +616,7 @@ def create_authorized_certificate(
615616
] = None,
616617
*,
617618
retry: OptionalRetry = gapic_v1.method.DEFAULT,
618-
timeout: Optional[float] = None,
619+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
619620
metadata: Sequence[Tuple[str, str]] = (),
620621
) -> certificate.AuthorizedCertificate:
621622
r"""Uploads the specified SSL certificate.
@@ -702,7 +703,7 @@ def update_authorized_certificate(
702703
] = None,
703704
*,
704705
retry: OptionalRetry = gapic_v1.method.DEFAULT,
705-
timeout: Optional[float] = None,
706+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
706707
metadata: Sequence[Tuple[str, str]] = (),
707708
) -> certificate.AuthorizedCertificate:
708709
r"""Updates the specified SSL certificate. To renew a certificate
@@ -794,7 +795,7 @@ def delete_authorized_certificate(
794795
] = None,
795796
*,
796797
retry: OptionalRetry = gapic_v1.method.DEFAULT,
797-
timeout: Optional[float] = None,
798+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
798799
metadata: Sequence[Tuple[str, str]] = (),
799800
) -> None:
800801
r"""Deletes the specified SSL certificate.
@@ -873,14 +874,9 @@ def __exit__(self, type, value, traceback):
873874
self.transport.close()
874875

875876

876-
try:
877-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
878-
gapic_version=pkg_resources.get_distribution(
879-
"google-cloud-appengine-admin",
880-
).version,
881-
)
882-
except pkg_resources.DistributionNotFound:
883-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
877+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
878+
gapic_version=package_version.__version__
879+
)
884880

885881

886882
__all__ = ("AuthorizedCertificatesClient",)

google/cloud/appengine_admin_v1/services/authorized_certificates/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.appengine_admin_v1 import gapic_version as package_version
2929
from google.cloud.appengine_admin_v1.types import appengine, certificate
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-appengine-admin",
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 AuthorizedCertificatesTransport(abc.ABC):

0 commit comments

Comments
 (0)