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

Commit cbcb79c

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

File tree

8 files changed

+49
-50
lines changed

8 files changed

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

google/cloud/bigquery_connection_v1/services/connection_service/async_client.py

Lines changed: 13 additions & 17 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.bigquery_connection_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 create_connection(
226227
connection: Optional[gcbc_connection.Connection] = None,
227228
connection_id: Optional[str] = None,
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
) -> gcbc_connection.Connection:
232233
r"""Creates a new connection.
@@ -345,7 +346,7 @@ async def get_connection(
345346
*,
346347
name: Optional[str] = None,
347348
retry: OptionalRetry = gapic_v1.method.DEFAULT,
348-
timeout: Optional[float] = None,
349+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
349350
metadata: Sequence[Tuple[str, str]] = (),
350351
) -> connection.Connection:
351352
r"""Returns specified connection.
@@ -458,7 +459,7 @@ async def list_connections(
458459
*,
459460
parent: Optional[str] = None,
460461
retry: OptionalRetry = gapic_v1.method.DEFAULT,
461-
timeout: Optional[float] = None,
462+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
462463
metadata: Sequence[Tuple[str, str]] = (),
463464
) -> pagers.ListConnectionsAsyncPager:
464465
r"""Returns a list of connections in the given project.
@@ -586,7 +587,7 @@ async def update_connection(
586587
connection: Optional[gcbc_connection.Connection] = None,
587588
update_mask: Optional[field_mask_pb2.FieldMask] = None,
588589
retry: OptionalRetry = gapic_v1.method.DEFAULT,
589-
timeout: Optional[float] = None,
590+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
590591
metadata: Sequence[Tuple[str, str]] = (),
591592
) -> gcbc_connection.Connection:
592593
r"""Updates the specified connection. For security
@@ -709,7 +710,7 @@ async def delete_connection(
709710
*,
710711
name: Optional[str] = None,
711712
retry: OptionalRetry = gapic_v1.method.DEFAULT,
712-
timeout: Optional[float] = None,
713+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
713714
metadata: Sequence[Tuple[str, str]] = (),
714715
) -> None:
715716
r"""Deletes connection and associated credential.
@@ -809,7 +810,7 @@ async def get_iam_policy(
809810
*,
810811
resource: Optional[str] = None,
811812
retry: OptionalRetry = gapic_v1.method.DEFAULT,
812-
timeout: Optional[float] = None,
813+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
813814
metadata: Sequence[Tuple[str, str]] = (),
814815
) -> policy_pb2.Policy:
815816
r"""Gets the access control policy for a resource.
@@ -977,7 +978,7 @@ async def set_iam_policy(
977978
*,
978979
resource: Optional[str] = None,
979980
retry: OptionalRetry = gapic_v1.method.DEFAULT,
980-
timeout: Optional[float] = None,
981+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
981982
metadata: Sequence[Tuple[str, str]] = (),
982983
) -> policy_pb2.Policy:
983984
r"""Sets the access control policy on the specified resource.
@@ -1148,7 +1149,7 @@ async def test_iam_permissions(
11481149
resource: Optional[str] = None,
11491150
permissions: Optional[MutableSequence[str]] = None,
11501151
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1151-
timeout: Optional[float] = None,
1152+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11521153
metadata: Sequence[Tuple[str, str]] = (),
11531154
) -> iam_policy_pb2.TestIamPermissionsResponse:
11541155
r"""Returns permissions that a caller has on the specified resource.
@@ -1272,14 +1273,9 @@ async def __aexit__(self, exc_type, exc, tb):
12721273
await self.transport.close()
12731274

12741275

1275-
try:
1276-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1277-
gapic_version=pkg_resources.get_distribution(
1278-
"google-cloud-bigquery-connection",
1279-
).version,
1280-
)
1281-
except pkg_resources.DistributionNotFound:
1282-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1276+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1277+
gapic_version=package_version.__version__
1278+
)
12831279

12841280

12851281
__all__ = ("ConnectionServiceAsyncClient",)

google/cloud/bigquery_connection_v1/services/connection_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -455,7 +456,7 @@ def create_connection(
455456
connection: Optional[gcbc_connection.Connection] = None,
456457
connection_id: Optional[str] = None,
457458
retry: OptionalRetry = gapic_v1.method.DEFAULT,
458-
timeout: Optional[float] = None,
459+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
459460
metadata: Sequence[Tuple[str, str]] = (),
460461
) -> gcbc_connection.Connection:
461462
r"""Creates a new connection.
@@ -574,7 +575,7 @@ def get_connection(
574575
*,
575576
name: Optional[str] = None,
576577
retry: OptionalRetry = gapic_v1.method.DEFAULT,
577-
timeout: Optional[float] = None,
578+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
578579
metadata: Sequence[Tuple[str, str]] = (),
579580
) -> connection.Connection:
580581
r"""Returns specified connection.
@@ -677,7 +678,7 @@ def list_connections(
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.ListConnectionsPager:
683684
r"""Returns a list of connections in the given project.
@@ -795,7 +796,7 @@ def update_connection(
795796
connection: Optional[gcbc_connection.Connection] = None,
796797
update_mask: Optional[field_mask_pb2.FieldMask] = None,
797798
retry: OptionalRetry = gapic_v1.method.DEFAULT,
798-
timeout: Optional[float] = None,
799+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
799800
metadata: Sequence[Tuple[str, str]] = (),
800801
) -> gcbc_connection.Connection:
801802
r"""Updates the specified connection. For security
@@ -918,7 +919,7 @@ def delete_connection(
918919
*,
919920
name: Optional[str] = None,
920921
retry: OptionalRetry = gapic_v1.method.DEFAULT,
921-
timeout: Optional[float] = None,
922+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
922923
metadata: Sequence[Tuple[str, str]] = (),
923924
) -> None:
924925
r"""Deletes connection and associated credential.
@@ -1008,7 +1009,7 @@ def get_iam_policy(
10081009
*,
10091010
resource: Optional[str] = None,
10101011
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1011-
timeout: Optional[float] = None,
1012+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10121013
metadata: Sequence[Tuple[str, str]] = (),
10131014
) -> policy_pb2.Policy:
10141015
r"""Gets the access control policy for a resource.
@@ -1173,7 +1174,7 @@ def set_iam_policy(
11731174
*,
11741175
resource: Optional[str] = None,
11751176
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1176-
timeout: Optional[float] = None,
1177+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11771178
metadata: Sequence[Tuple[str, str]] = (),
11781179
) -> policy_pb2.Policy:
11791180
r"""Sets the access control policy on the specified resource.
@@ -1341,7 +1342,7 @@ def test_iam_permissions(
13411342
resource: Optional[str] = None,
13421343
permissions: Optional[MutableSequence[str]] = None,
13431344
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1344-
timeout: Optional[float] = None,
1345+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13451346
metadata: Sequence[Tuple[str, str]] = (),
13461347
) -> iam_policy_pb2.TestIamPermissionsResponse:
13471348
r"""Returns permissions that a caller has on the specified resource.
@@ -1470,14 +1471,9 @@ def __exit__(self, type, value, traceback):
14701471
self.transport.close()
14711472

14721473

1473-
try:
1474-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1475-
gapic_version=pkg_resources.get_distribution(
1476-
"google-cloud-bigquery-connection",
1477-
).version,
1478-
)
1479-
except pkg_resources.DistributionNotFound:
1480-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1474+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1475+
gapic_version=package_version.__version__
1476+
)
14811477

14821478

14831479
__all__ = ("ConnectionServiceClient",)

google/cloud/bigquery_connection_v1/services/connection_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,14 @@
2626
from google.iam.v1 import policy_pb2 # type: ignore
2727
from google.oauth2 import service_account # type: ignore
2828
from google.protobuf import empty_pb2 # type: ignore
29-
import pkg_resources
3029

30+
from google.cloud.bigquery_connection_v1 import gapic_version as package_version
3131
from google.cloud.bigquery_connection_v1.types import connection as gcbc_connection
3232
from google.cloud.bigquery_connection_v1.types import connection
3333

34-
try:
35-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
36-
gapic_version=pkg_resources.get_distribution(
37-
"google-cloud-bigquery-connection",
38-
).version,
39-
)
40-
except pkg_resources.DistributionNotFound:
41-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
34+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
35+
gapic_version=package_version.__version__
36+
)
4237

4338

4439
class ConnectionServiceTransport(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/bigquery_connection/gapic_version.py",
8+
"google/cloud/bigquery_connection_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.bigquery.connection.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
"grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev",

testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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
1010
grpc-google-iam-v1==0.12.4

0 commit comments

Comments
 (0)