8000 fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#258) · googleapis/google-cloud-python@2642f49 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2642f49

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#258)
* 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: googleapis/googleapis-gen@387b734 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 1c9d451 commit 2642f49

File tree

9 files changed

+71
-73
lines changed

9 files changed

+71
-73
lines changed

packages/google-cloud-access-approval/.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.9.0" # {x-release-please-version}

packages/google-cloud-access-approval/google/cloud/accessapproval_v1/services/access_approval/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retr 9E88 y, gapic_v1.method._MethodDefault]
@@ -273,7 +274,7 @@ async def list_approval_requests(
273274
*,
274275
parent: Optional[str] = None,
275276
retry: OptionalRetry = gapic_v1.method.DEFAULT,
276-
timeout: Optional[float] = None,
277+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
277278
metadata: Sequence[Tuple[str, str]] = (),
278279
) -> pagers.ListApprovalRequestsAsyncPager:
279280
r"""Lists approval requests associated with a project,
@@ -400,7 +401,7 @@ async def get_approval_request(
400401
*,
401402
name: Optional[str] = None,
402403
retry: OptionalRetry = gapic_v1.method.DEFAULT,
403-
timeout: Optional[float] = None,
404+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
404405
metadata: Sequence[Tuple[str, str]] = (),
405406
) -> accessapproval.ApprovalRequest:
406407
r"""Gets an approval request. Returns NOT_FOUND if the request does
@@ -511,7 +512,7 @@ async def approve_approval_request(
511512
] = None,
512513
*,
513514
retry: OptionalRetry = gapic_v1.method.DEFAULT,
514-
timeout: Optional[float] = None,
515+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
515516
metadata: Sequence[Tuple[str, str]] = (),
516517
) -> accessapproval.ApprovalRequest:
517518
r"""Approves a request and returns the updated ApprovalRequest.
@@ -596,7 +597,7 @@ async def dismiss_approval_request(
596597
] = None,
597598
*,
598599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
599-
timeout: Optional[float] = None,
600+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
600601
metadata: Sequence[Tuple[str, str]] = (),
601602
) -> accessapproval.ApprovalRequest:
602603
r"""Dismisses a request. Returns the updated ApprovalRequest.
@@ -686,7 +687,7 @@ async def invalidate_approval_request(
686687
] = None,
687688
*,
688689
retry: OptionalRetry = gapic_v1.method.DEFAULT,
689-
timeout: Optional[float] = None,
690+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
690691
metadata: Sequence[Tuple[str, str]] = (),
691692
) -> accessapproval.ApprovalRequest:
692693
r"""Invalidates an existing ApprovalRequest. Returns the updated
@@ -776,7 +777,7 @@ async def get_access_approval_settings(
776777
*,
777778
name: Optional[str] = None,
778779
retry: OptionalRetry = gapic_v1.method.DEFAULT,
779-
timeout: Optional[float] = None,
780+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
780781
metadata: Sequence[Tuple[str, str]] = (),
781782
) -> accessapproval.AccessApprovalSettings:
782783
r"""Gets the settings associated with a project, folder,
@@ -892,7 +893,7 @@ async def update_access_approval_settings(
892893
settings: Optional[accessapproval.AccessApprovalSettings] = None,
893894
update_mask: Optional[field_mask_pb2.FieldMask] = None,
894895
retry: OptionalRetry = gapic_v1.method.DEFAULT,
895-
timeout: Optional[float] = None,
896+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
896897
metadata: Sequence[Tuple[str, str]] = (),
897898
) -> accessapproval.AccessApprovalSettings:
898899
r"""Updates the settings associated with a project, folder, or
@@ -1016,7 +1017,7 @@ as 10000 ync def delete_access_approval_settings(
10161017
*,
10171018
name: Optional[str] = None,
10181019
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1019-
timeout: Optional[float] = None,
1020+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10201021
metadata: Sequence[Tuple[str, str]] = (),
10211022
) -> None:
10221023
r"""Deletes the settings associated with a project,
@@ -1114,7 +1115,7 @@ async def get_access_approval_service_account(
11141115
*,
11151116
name: Optional[str] = None,
11161117
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1117-
timeout: Optional[float] = None,
1118+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11181119
metadata: Sequence[Tuple[str, str]] = (),
11191120
) -> accessapproval.AccessApprovalServiceAccount:
11201121
r"""Retrieves the service account that is used by Access
@@ -1220,14 +1221,9 @@ async def __aexit__(self, exc_type, exc, tb):
12201221
await self.transport.close()
12211222

12221223

1223-
try:
1224-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1225-
gapic_version=pkg_resources.get_distribution(
1226-
"google-cloud-access-approval",
1227-
).version,
1228-
)
1229-
except pkg_resources.DistributionNotFound:
1230-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1224+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1225+
gapic_version=package_version.__version__
1226+
)
12311227

12321228

12331229
__all__ = ("AccessApprovalAsyncClient",)

packages/google-cloud-access-approval/google/cloud/accessapproval_v1/services/access_approval/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -514,7 +515,7 @@ def list_approval_requests(
514515
*,
515516
parent: Optional[str] = None,
516517
retry: OptionalRetry = gapic_v1.method.DEFAULT,
517-
timeout: Optional[float] = None,
518+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
518519
metadata: Sequence[Tuple[str, str]] = (),
519520
) -> pagers.ListApprovalRequestsPager:
520521
r"""Lists approval requests associated with a project,
@@ -632,7 +633,7 @@ def get_approval_request(
632633
*,
633634
name: Optional[str] = None,
634635
retry: OptionalRetry = gapic_v1.method.DEFAULT,
635-
timeout: Optional[float] = None,
636+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
636637
metadata: Sequence[Tuple[str, str]] = (),
637638
) -> accessapproval.ApprovalRequest:
638639
r"""Gets an approval request. Returns NOT_FOUND if the request does
@@ -734,7 +735,7 @@ def approve_approval_request(
734735
] = None,
735736
*,
736737
retry: OptionalRetry = gapic_v1.method.DEFAULT,
737-
timeout: Optional[float] = None,
738+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
738739
metadata: Sequence[Tuple[str, str]] = (),
739740
) -> accessapproval.ApprovalRequest:
740741
r"""Approves a request and returns the updated ApprovalRequest.
@@ -820,7 +821,7 @@ def dismiss_approval_request(
820821
] = None,
821822
*,
822823
retry: OptionalRetry = gapic_v1.method.DEFAULT,
823-
timeout: Optional[float] = None,
824+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
824825
metadata: Sequence[Tuple[str, str]] = (),
825826
) -> accessapproval.ApprovalRequest:
826827
r"""Dismisses a request. Returns the updated ApprovalRequest.
@@ -911,7 +912,7 @@ def invalidate_approval_request(
911912
] = None,
912913
*,
913914
retry: OptionalRetry = gapic_v1.method.DEFAULT,
914-
timeout: Optional[float] = None,
915+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
915916
metadata: Sequence[Tuple[str, str]] = (),
916917
) -> accessapproval.ApprovalRequest:
917918
r"""Invalidates an existing ApprovalRequest. Returns the updated
@@ -1004,7 +1005,7 @@ def get_access_approval_settings(
10041005
*,
10051006
name: Optional[str] = None,
10061007
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1007-
timeout: Optional[float] = None,
1008+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10081009
metadata: Sequence[Tuple[str, str]] = (),
10091010
) -> accessapproval.AccessApprovalSettings:
10101011
r"""Gets the settings associated with a project, folder,
@@ -1113,7 +1114,7 @@ def update_access_approval_settings(
11131114
settings: Optional[accessapproval.AccessApprovalSettings] = None,
11141115
update_mask: Optional[field_mask_pb2.FieldMask] = None,
11151116
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1116-
timeout: Optional[float] = None,
1117+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11171118
metadata: Sequence[Tuple[str, str]] = (),
11181119
) -> accessapproval.AccessApprovalSettings:
11191120
r"""Updates the settings associated with a project, folder, or
@@ -1239,7 +1240,7 @@ def delete_access_approval_settings(
12391240
*,
12401241
name: Optional[str] = None,
12411242
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1242-
timeout: Optional[float] = None,
1243+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12431244
metadata: Sequence[Tuple[str, str]] = (),
12441245
) -> None:
12451246
r"""Deletes the settings associated with a project,
@@ -1339,7 +1340,7 @@ def get_access_approval_service_account(
13391340
*,
13401341
name: Optional[str] = None,
13411342
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1342-
timeout: Optional[float] = None,
1343+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13431344
metadata: Sequence[Tuple[str, str]] = (),
13441345
) -> accessapproval.AccessApprovalServiceAccount:
13451346
r"""Retrieves the service account that is used by Access
@@ -1456,14 +1457,9 @@ def __exit__(self, type, value, traceback):
14561457
self.transport.close()
14571458

14581459

1459-
try:
1460-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1461-
gapic_version=pkg_resources.get_distribution(
1462-
"google-cloud-access-approval",
1463-
).version,
1464-
)
1465-
except pkg_resources.DistributionNotFound:
1466-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1460+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1461+
gapic_version=package_version.__version__
1462+
)
14671463

14681464

14691465
__all__ = ("AccessApprovalClient",)

packages/google-cloud-access-approval/google/cloud/accessapproval_v1/services/access_approval/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.accessapproval_v1 import gapic_version as package_version
2929
from google.cloud.accessapproval_v1.types import accessapproval
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-access-approval",
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 AccessApprovalTransport(abc.ABC):
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"$schema":
3-
"https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
4-
"packages": {
5-
".": {
6-
"release-type": "python",
7-
"extra-files": [
8-
"google/cloud/accessapproval/gapic_version.py",
9-
{
10-
"type": "json",
11-
"path": "samples/generated_samples/snippet_metadata_google.cloud.accessapproval.v1.json",
12-
"jsonpath": "$.clientLibrary.version"
13-
}
14-
]
15-
}
16-
},
17-
"release-type": "python",
18-
"plugins": [
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "python",
6+
"extra-files": [
7+
"google/cloud/accessapproval/gapic_version.py",
8+
"google/cloud/accessapproval_v1/gapic_version.py",
199
{
20-
"type": "sentence-case"
10+
"type": "json",
11+
"path": "samples/generated_samples/snippet_metadata_google.cloud.accessapproval.v1.json",
12+
"jsonpath": "$.clientLibrary.version"
2113
}
22-
],
23-
"initial-version": "0.1.0"
14+
]
15+
}
16+
},
17+
"release-type": "python",
18+
"plugins": [
19+
{
20+
"type": "sentence-case"
21+
}
22+
],
23+
"initial-version": "0.1.0"
2424
}

packages/google-cloud-access-approval/samples/generated_samples/snippet_metadata_google.cloud.accessapproval.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-access-approval",
11-
"version": "1.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-access-approval/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
]

packages/google-cloud-access-approval/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)
0