Skip to content

Commit 1d74161

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#236)
* 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 db642bd commit 1d74161

File tree

8 files changed

+47
-48
lines changed

8 files changed

+47
-48
lines changed

packages/google-cloud-os-login/.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__ = "2.7.4" # {x-release-please-version}

packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_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.oslogin_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -232,7 +233,7 @@ async def create_ssh_public_key(
232233
parent: Optional[str] = None,
233234
ssh_public_key: Optional[common.SshPublicKey] = None,
234235
retry: OptionalRetry = gapic_v1.method.DEFAULT,
235-
timeout: Optional[float] = None,
236+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
236237
metadata: Sequence[Tuple[str, str]] = (),
237238
) -> common.SshPublicKey:
238239
r"""Create an SSH public key
@@ -343,7 +344,7 @@ async def delete_posix_account(
343344
*,
344345
name: Optional[str] = None,
345346
retry: OptionalRetry = gapic_v1.method.DEFAULT,
346-
timeout: Optional[float] = None,
347+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
347348
metadata: Sequence[Tuple[str, str]] = (),
348349
) -> None:
349350
r"""Deletes a POSIX account.
@@ -445,7 +446,7 @@ async def delete_ssh_public_key(
445446
*,
446447
name: Optional[str] = None,
447448
retry: OptionalRetry = gapic_v1.method.DEFAULT,
448-
timeout: Optional[float] = None,
449+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
449450
metadata: Sequence[Tuple[str, str]] = (),
450451
) -> None:
451452
r"""Deletes an SSH public key.
@@ -547,7 +548,7 @@ async def get_login_profile(
547548
*,
548549
name: Optional[str] = None,
549550
retry: OptionalRetry = gapic_v1.method.DEFAULT,
550-
timeout: Optional[float] = None,
551+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
551552
metadata: Sequence[Tuple[str, str]] = (),
552553
) -> oslogin.LoginProfile:
553554
r"""Retrieves the profile information used for logging in
@@ -661,7 +662,7 @@ async def get_ssh_public_key(
661662
*,
662663
name: Optional[str] = None,
663664
retry: OptionalRetry = gapic_v1.method.DEFAULT,
664-
timeout: Optional[float] = None,
665+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
665666
metadata: Sequence[Tuple[str, str]] = (),
666667
) -> common.SshPublicKey:
667668
r"""Retrieves an SSH public key.
@@ -777,7 +778,7 @@ async def import_ssh_public_key(
777778
ssh_public_key: Optional[common.SshPublicKey] = None,
778779
project_id: Optional[str] = None,
779780
retry: OptionalRetry = gapic_v1.method.DEFAULT,
780-
timeout: Optional[float] = None,
781+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
781782
metadata: Sequence[Tuple[str, str]] = (),
782783
) -> oslogin.ImportSshPublicKeyResponse:
783784
r"""Adds an SSH public key and returns the profile
@@ -912,7 +913,7 @@ async def update_ssh_public_key(
912913
ssh_public_key: Optional[common.SshPublicKey] = None,
913914
update_mask: Optional[field_mask_pb2.FieldMask] = None,
914915
retry: OptionalRetry = gapic_v1.method.DEFAULT,
915-
timeout: Optional[float] = None,
916+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
916917
metadata: Sequence[Tuple[str, str]] = (),
917918
) -> common.SshPublicKey:
918919
r"""Updates an SSH public key and returns the profile
@@ -1046,14 +1047,9 @@ async def __aexit__(self, exc_type, exc, tb):
10461047
await self.transport.close()
10471048

10481049

1049-
try:
1050-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1051-
gapic_version=pkg_resources.get_distribution(
1052-
"google-cloud-os-login",
1053-
).version,
1054-
)
1055-
except pkg_resources.DistributionNotFound:
1056-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1050+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1051+
gapic_version=package_version.__version__
1052+
)
10571053

10581054

10591055
__all__ = ("OsLoginServiceAsyncClient",)

packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_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.oslogin_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -465,7 +466,7 @@ def create_ssh_public_key(
465466
parent: Optional[str] = None,
466467
ssh_public_key: Optional[common.SshPublicKey] = None,
467468
retry: OptionalRetry = gapic_v1.method.DEFAULT,
468-
timeout: Optional[float] = None,
469+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
469470
metadata: Sequence[Tuple[str, str]] = (),
470471
) -> common.SshPublicKey:
471472
r"""Create an SSH public key
@@ -576,7 +577,7 @@ def delete_posix_account(
576577
*,
577578
name: Optional[str] = None,
578579
retry: OptionalRetry = gapic_v1.method.DEFAULT,
579-
timeout: Optional[float] = None,
580+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
580581
metadata: Sequence[Tuple[str, str]] = (),
581582
) -> None:
582583
r"""Deletes a POSIX account.
@@ -668,7 +669,7 @@ def delete_ssh_public_key(
668669
*,
669670
name: Optional[str] = None,
670671
retry: OptionalRetry = gapic_v1.method.DEFAULT,
671-
timeout: Optional[float] = None,
672+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
672673
metadata: Sequence[Tuple[str, str]] = (),
673674
) -> None:
674675
r"""Deletes an SSH public key.
@@ -760,7 +761,7 @@ def get_login_profile(
760761
*,
761762
name: Optional[str] = None,
762763
retry: OptionalRetry = gapic_v1.method.DEFAULT,
763-
timeout: Optional[float] = None,
764+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
764765
metadata: Sequence[Tuple[str, str]] = (),
765766
) -> oslogin.LoginProfile:
766767
r"""Retrieves the profile information used for logging in
@@ -864,7 +865,7 @@ def get_ssh_public_key(
864865
*,
865866
name: Optional[str] = None,
866867
retry: OptionalRetry = gapic_v1.method.DEFAULT,
867-
timeout: Optional[float] = None,
868+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
868869
metadata: Sequence[Tuple[str, str]] = (),
869870
) -> common.SshPublicKey:
870871
r"""Retrieves an SSH public key.
@@ -970,7 +971,7 @@ def import_ssh_public_key(
970971
ssh_public_key: Optional[common.SshPublicKey] = None,
971972
project_id: Optional[str] = None,
972973
retry: OptionalRetry = gapic_v1.method.DEFAULT,
973-
timeout: Optional[float] = None,
974+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
974975
metadata: Sequence[Tuple[str, str]] = (),
975976
) -> oslogin.ImportSshPublicKeyResponse:
976977
r"""Adds an SSH public key and returns the profile
@@ -1095,7 +1096,7 @@ def update_ssh_public_key(
10951096
ssh_public_key: Optional[common.SshPublicKey] = None,
10961097
update_mask: Optional[field_mask_pb2.FieldMask] = None,
10971098
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1098-
timeout: Optional[float] = None,
1099+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10991100
metadata: Sequence[Tuple[str, str]] = (),
11001101
) -> common.SshPublicKey:
11011102
r"""Updates an SSH public key and returns the profile
@@ -1226,14 +1227,9 @@ def __exit__(self, type, value, traceback):
12261227
self.transport.close()
12271228

12281229

1229-
try:
1230-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1231-
gapic_version=pkg_resources.get_distribution(
1232-
"google-cloud-os-login",
1233-
).version,
1234-
)
1235-
except pkg_resources.DistributionNotFound:
1236-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1230+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1231+
gapic_version=package_version.__version__
1232+
)
12371233

12381234

12391235
__all__ = ("OsLoginServiceClient",)

packages/google-cloud-os-login/google/cloud/oslogin_v1/services/os_login_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@
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

2928
from google.cloud.oslogin_v1 import common # type: ignore
29+
from google.cloud.oslogin_v1 import gapic_version as package_version
3030
from google.cloud.oslogin_v1.types import oslogin
3131

32-
try:
33-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
34-
gapic_version=pkg_resources.get_distribution(
35-
"google-cloud-os-login",
36-
).version,
37-
)
38-
except pkg_resources.DistributionNotFound:
39-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
32+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33+
gapic_version=package_version.__version__
34+
)
4035

4136

4237
class OsLoginServiceTransport(abc.ABC):

packages/google-cloud-os-login/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/oslogin/gapic_version.py",
8+
"google/cloud/oslogin_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.oslogin.v1.json",

packages/google-cloud-os-login/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
release_status = "Development Status :: 5 - Production/Stable"
3737

3838
dependencies = [
39-
"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.*",
39+
"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.*",
4040
"proto-plus >= 1.22.0, <2.0.0dev",
4141
"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",
4242
]

packages/google-cloud-os-login/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)