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

Commit 1b16d16

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

Some content is hidden

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

41 files changed

+284
-385
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__ = "2.7.3" # {x-release-please-version}

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -229,7 +230,7 @@ async def create_company(
229230
parent: Optional[str] = None,
230231
company: Optional[gct_company.Company] = None,
231232
retry: OptionalRetry = gapic_v1.method.DEFAULT,
232-
timeout: Optional[float] = None,
233+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
233234
metadata: Sequence[Tuple[str, str]] = (),
234235
) -> gct_company.Company:
235236
r"""Creates a new company entity.
@@ -351,7 +352,7 @@ async def get_company(
351352
*,
352353
name: Optional[str] = None,
353354
retry: OptionalRetry = gapic_v1.method.DEFAULT,
354-
timeout: Optional[float] = None,
355+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
355356
metadata: Sequence[Tuple[str, str]] = (),
356357
) -> company.Company:
357358
r"""Retrieves specified company.
@@ -473,7 +474,7 @@ async def update_company(
473474
company: Optional[gct_company.Company] = None,
474475
update_mask: Optional[field_mask_pb2.FieldMask] = None,
475476
retry: OptionalRetry = gapic_v1.method.DEFAULT,
476-
timeout: Optional[float] = None,
477+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
477478
metadata: Sequence[Tuple[str, str]] = (),
478479
) -> gct_company.Company:
479480
r"""Updates specified company.
@@ -604,7 +605,7 @@ async def delete_company(
604605
*,
605606
name: Optional[str] = None,
606607
retry: OptionalRetry = gapic_v1.method.DEFAULT,
607-
timeout: Optional[float] = None,
608+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
608609
metadata: Sequence[Tuple[str, str]] = (),
609610
) -> None:
610611
r"""Deletes specified company.
@@ -709,7 +710,7 @@ async def list_companies(
709710
*,
710711
parent: 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
) -> pagers.ListCompaniesAsyncPager:
715716
r"""Lists all companies associated with the project.
@@ -838,14 +839,9 @@ async def __aexit__(self, exc_type, exc, tb):
838839
await self.transport.close()
839840

840841

841-
try:
842-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
843-
gapic_version=pkg_resources.get_distribution(
844-
"google-cloud-talent",
845-
).version,
846-
)
847-
except pkg_resources.DistributionNotFound:
848-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
842+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
843+
gapic_version=package_version.__version__
844+
)
849845

850846

851847
__all__ = ("CompanyServiceAsyncClient",)

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -471,7 +472,7 @@ def create_company(
471472
parent: Optional[str] = None,
472473
company: Optional[gct_company.Company] = None,
473474
retry: OptionalRetry = gapic_v1.method.DEFAULT,
474-
timeout: Optional[float] = None,
475+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
475476
metadata: Sequence[Tuple[str, str]] = (),
476477
) -> gct_company.Company:
477478
r"""Creates a new company entity.
@@ -593,7 +594,7 @@ def get_company(
593594
*,
594595
name: Optional[str] = None,
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
) -> company.Company:
599600
r"""Retrieves specified company.
@@ -705,7 +706,7 @@ def update_company(
705706
company: Optional[gct_company.Company] = None,
706707
update_mask: Optional[field_mask_pb2.FieldMask] = None,
707708
retry: OptionalRetry = gapic_v1.method.DEFAULT,
708-
timeout: Optional[float] = None,
709+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
709710
metadata: Sequence[Tuple[str, str]] = (),
710711
) -> gct_company.Company:
711712
r"""Updates specified company.
@@ -836,7 +837,7 @@ def delete_company(
836837
*,
837838
name: Optional[str] = None,
838839
retry: OptionalRetry = gapic_v1.method.DEFAULT,
839-
timeout: Optional[float] = None,
840+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
840841
metadata: Sequence[Tuple[str, str]] = (),
841842
) -> None:
842843
r"""Deletes specified company.
@@ -931,7 +932,7 @@ def list_companies(
931932
*,
932933
parent: Optional[str] = None,
933934
retry: OptionalRetry = gapic_v1.method.DEFAULT,
934-
timeout: Optional[float] = None,
935+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
935936
metadata: Sequence[Tuple[str, str]] = (),
936937
) -> pagers.ListCompaniesPager:
937938
r"""Lists all companies associated with the project.
@@ -1057,14 +1058,9 @@ def __exit__(self, type, value, traceback):
10571058
self.transport.close()
10581059

10591060

1060-
try:
1061-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1062-
gapic_version=pkg_resources.get_distribution(
1063-
"google-cloud-talent",
1064-
).version,
1065-
)
1066-
except pkg_resources.DistributionNotFound:
1067-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1061+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1062+
gapic_version=package_version.__version__
1063+
)
10681064

10691065

10701066
__all__ = ("CompanyServiceClient",)

google/cloud/talent_v4/services/company_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,15 @@
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.talent_v4 import gapic_version as package_version
2929
from google.cloud.talent_v4.types import company
3030
from google.cloud.talent_v4.types import company as gct_company
3131
from google.cloud.talent_v4.types import company_service
3232

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

4237

4338
class CompanyServiceTransport(abc.ABC):

google/cloud/talent_v4/services/completion/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -213,7 +214,7 @@ async def complete_query(
213214
request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None,
214215
*,
215216
retry: OptionalRetry = gapic_v1.method.DEFAULT,
216-
timeout: Optional[float] = None,
217+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
217218
metadata: Sequence[Tuple[str, str]] = (),
218219
) -> completion_service.CompleteQueryResponse:
219220
r"""Completes the specified prefix with keyword
@@ -306,14 +307,9 @@ async def __aexit__(self, exc_type, exc, tb):
306307
await self.transport.close()
307308

308309

309-
try:
310-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
311-
gapic_version=pkg_resources.get_distribution(
312-
"google-cloud-talent",
313-
).version,
314-
)
315-
except pkg_resources.DistributionNotFound:
316-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
310+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
311+
gapic_version=package_version.__version__
312+
)
317313

318314

319315
__all__ = ("CompletionAsyncClient",)

google/cloud/talent_v4/services/completion/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -459,7 +460,7 @@ def complete_query(
459460
request: Optional[Union[completion_service.CompleteQueryRequest, dict]] = None,
460461
*,
461462
retry: OptionalRetry = gapic_v1.method.DEFAULT,
462-
timeout: Optional[float] = None,
463+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
463464
metadata: Sequence[Tuple[str, str]] = (),
464465
) -> completion_service.CompleteQueryResponse:
465466
r"""Completes the specified prefix with keyword
@@ -550,14 +551,9 @@ def __exit__(self, type, value, traceback):
550551
self.transport.close()
551552

552553

553-
try:
554-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
555-
gapic_version=pkg_resources.get_distribution(
556-
"google-cloud-talent",
557-
).version,
558-
)
559-
except pkg_resources.DistributionNotFound:
560-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
554+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
555+
gapic_version=package_version.__version__
556+
)
561557

562558

563559
__all__ = ("CompletionClient",)

google/cloud/talent_v4/services/completion/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,13 @@
2323
import google.auth # type: ignore
2424
from google.auth import credentials as ga_credentials # type: ignore
2525
from google.oauth2 import service_account # type: ignore
26-
import pkg_resources
2726

27+
from google.cloud.talent_v4 import gapic_version as package_version
2828
from google.cloud.talent_v4.types import completion_service
2929

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-talent",
34-
).version,
35-
)
36-
except pkg_resources.DistributionNotFound:
37-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
30+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
31+
gapic_version=package_version.__version__
32+
)
3833

3934

4035
class CompletionTransport(abc.ABC):

google/cloud/talent_v4/services/event_service/async_client.py

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -217,7 +218,7 @@ async def create_client_event(
217218
parent: Optional[str] = None,
218219
client_event: Optional[event.ClientEvent] = 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
) -> event.ClientEvent:
223224
r"""Report events issued when end user interacts with customer's
@@ -353,14 +354,9 @@ async def __aexit__(self, exc_type, exc, tb):
353354
await self.transport.close()
354355

355356

356-
try:
357-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
358-
gapic_version=pkg_resources.get_distribution(
359-
"google-cloud-talent",
360-
).version,
361-
)
362-
except pkg_resources.DistributionNotFound:
363-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
357+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
358+
gapic_version=package_version.__version__
359+
)
364360

365361

366362
__all__ = ("EventServiceAsyncClient",)

google/cloud/talent_v4/services/event_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -441,7 +442,7 @@ def create_client_event(
441442
parent: Optional[str] = None,
442443
client_event: Optional[event.ClientEvent] = None,
443444
retry: OptionalRetry = gapic_v1.method.DEFAULT,
444-
timeout: Optional[float] = None,
445+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
445446
metadata: Sequence[Tuple[str, str]] = (),
446447
) -> event.ClientEvent:
447448
r"""Report events issued when end user interacts with customer's
@@ -584,14 +585,9 @@ def __exit__(self, type, value, traceback):
584585
self.transport.close()
585586

586587

587-
try:
588-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
589-
gapic_version=pkg_resources.get_distribution(
590-
"google-cloud-talent",
591-
).version,
592-
)
593-
except pkg_resources.DistributionNotFound:
594-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
588+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
589+
gapic_version=package_version.__version__
590+
)
595591

596592

597593
__all__ = ("EventServiceClient",)

0 commit comments

Comments
 (0)