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

Commit d3ef952

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#141)
* 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 f7be6d0 commit d3ef952

File tree

8 files changed

+45
-45
lines changed

8 files changed

+45
-45
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__ = "0.6.3" # {x-release-please-version}

google/cloud/gkeconnect/gateway_v1beta1/services/gateway_service/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.gkeconnect.gateway_v1beta1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -222,7 +223,7 @@ async def get_resource(
222223
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
223224
*,
224225
retry: OptionalRetry = gapic_v1.method.DEFAULT,
225-
timeout: Optional[float] = None,
226+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
226227
metadata: Sequence[Tuple[str, str]] = (),
227228
) -> httpbody_pb2.HttpBody:
228229
r"""GetResource performs an HTTP GET request on the
@@ -387,7 +388,7 @@ async def post_resource(
387388
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
388389
*,
389390
retry: OptionalRetry = gapic_v1.method.DEFAULT,
390-
timeout: Optional[float] = None,
391+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
391392
metadata: Sequence[Tuple[str, str]] = (),
392393
) -> httpbody_pb2.HttpBody:
393394
r"""PostResource performs an HTTP POST on the Kubernetes
@@ -552,7 +553,7 @@ async def delete_resource(
552553
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
553554
*,
554555
retry: OptionalRetry = gapic_v1.method.DEFAULT,
555-
timeout: Optional[float] = None,
556+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
556557
metadata: Sequence[Tuple[str, str]] = (),
557558
) -> httpbody_pb2.HttpBody:
558559
r"""DeleteResource performs an HTTP DELETE on the
@@ -717,7 +718,7 @@ async def put_resource(
717718
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
718719
*,
719720
retry: OptionalRetry = gapic_v1.method.DEFAULT,
720-
timeout: Optional[float] = None,
721+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
721722
metadata: Sequence[Tuple[str, str]] = (),
722723
) -> httpbody_pb2.HttpBody:
723724
r"""PutResource performs an HTTP PUT on the Kubernetes
@@ -882,7 +883,7 @@ async def patch_resource(
882883
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
883884
*,
884885
retry: OptionalRetry = gapic_v1.method.DEFAULT,
885-
timeout: Optional[float] = None,
886+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
886887
metadata: Sequence[Tuple[str, str]] = (),
887888
) -> httpbody_pb2.HttpBody:
888889
r"""PatchResource performs an HTTP PATCH on the
@@ -1049,14 +1050,9 @@ async def __aexit__(self, exc_type, exc, tb):
10491050
await self.transport.close()
10501051

10511052

1052-
try:
1053-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1054-
gapic_version=pkg_resources.get_distribution(
1055-
"google-cloud-gke-connect-gateway",
1056-
).version,
1057-
)
1058-
except pkg_resources.DistributionNotFound:
1059-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1053+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1054+
gapic_version=package_version.__version__
1055+
)
10601056

10611057

10621058
__all__ = ("GatewayServiceAsyncClient",)

google/cloud/gkeconnect/gateway_v1beta1/services/gateway_service/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.gkeconnect.gateway_v1beta1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -429,7 +430,7 @@ def get_resource(
429430
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
430431
*,
431432
retry: OptionalRetry = gapic_v1.method.DEFAULT,
432-
timeout: Optional[float] = None,
433+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
433434
metadata: Sequence[Tuple[str, str]] = (),
434435
) -> httpbody_pb2.HttpBody:
435436
r"""GetResource performs an HTTP GET request on the
@@ -593,7 +594,7 @@ def post_resource(
593594
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
594595
*,
595596
retry: OptionalRetry = gapic_v1.method.DEFAULT,
596-
timeout: Optional[float] = None,
597+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
597598
metadata: Sequence[Tuple[str, str]] = (),
598599
) -> httpbody_pb2.HttpBody:
599600
r"""PostResource performs an HTTP POST on the Kubernetes
@@ -757,7 +758,7 @@ def delete_resource(
757758
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
758759
*,
759760
retry: OptionalRetry = gapic_v1.method.DEFAULT,
760-
timeout: Optional[float] = None,
761+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
761762
metadata: Sequence[Tuple[str, str]] = (),
762763
) -> httpbody_pb2.HttpBody:
763764
r"""DeleteResource performs an HTTP DELETE on the
@@ -921,7 +922,7 @@ def put_resource(
921922
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
922923
*,
923924
retry: OptionalRetry = gapic_v1.method.DEFAULT,
924-
timeout: Optional[float] = None,
925+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
925926
metadata: Sequence[Tuple[str, str]] = (),
926927
) -> httpbody_pb2.HttpBody:
927928
r"""PutResource performs an HTTP PUT on the Kubernetes
@@ -1085,7 +1086,7 @@ def patch_resource(
10851086
request: Optional[Union[httpbody_pb2.HttpBody, dict]] = None,
10861087
*,
10871088
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1088-
timeout: Optional[float] = None,
1089+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10891090
metadata: Sequence[Tuple[str, str]] = (),
10901091
) -> httpbody_pb2.HttpBody:
10911092
r"""PatchResource performs an HTTP PATCH on the
@@ -1258,14 +1259,9 @@ def __exit__(self, type, value, traceback):
12581259
self.transport.close()
12591260

12601261

1261-
try:
1262-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1263-
gapic_version=pkg_resources.get_distribution(
1264-
"google-cloud-gke-connect-gateway",
1265-
).version,
1266-
)
1267-
except pkg_resources.DistributionNotFound:
1268-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1262+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1263+
gapic_version=package_version.__version__
1264+
)
12691265

12701266

12711267
__all__ = ("GatewayServiceClient",)

google/cloud/gkeconnect/gateway_v1beta1/services/gateway_service/transports/base.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,12 @@
2424
import google.auth # type: ignore
2525
from google.auth import credentials as ga_credentials # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
28-
29-
try:
30-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
31-
gapic_version=pkg_resources.get_distribution(
32-
"google-cloud-gke-connect-gateway",
33-
).version,
34-
)
35-
except pkg_resources.DistributionNotFound:
36-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
27+
28+
from google.cloud.gkeconnect.gateway_v1beta1 import gapic_version as package_version
29+
30+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
31+
gapic_version=package_version.__version__
32+
)
3733

3834

3935
class GatewayServiceTransport(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/gkeconnect/gateway/gapic_version.py",
8+
"google/cloud/gkeconnect/gateway_v1beta1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.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)