Skip to content

Commit e477ab2

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#10793)
* 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: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjM4N2I3MzQ0Yzc1MjllZTQ0YmU4NGU2MTNiMTlhODIwNTA4YzYxMmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbnRlbnR3YXJlaG91c2UvLk93bEJvdC55YW1sIiwiaCI6IjM4N2I3MzQ0Yzc1MjllZTQ0YmU4NGU2MTNiMTlhODIwNTA4YzYxMmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpc2NvdmVyeWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWVudGVycHJpc2Vrbm93bGVkZ2VncmFwaC8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZtd2FyZWVuZ2luZS8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWdlby10eXBlLy5Pd2xCb3QueWFtbCIsImgiOiIzODdiNzM0NGM3NTI5ZWU0NGJlODRlNjEzYjE5YTgyMDUwOGM2MTJiIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjM4N2I3MzQ0Yzc1MjllZTQ0YmU4NGU2MTNiMTlhODIwNTA4YzYxMmIifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * workaround bugs in gapic generator python * work around bugs in gapic generator python * lint * revert * restore change Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 0453f27 commit e477ab2

File tree

89 files changed

+515
-606
lines changed

Some content is hidden

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

89 files changed

+515
-606
lines changed

packages/google-apps-script-type/.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-apps-script-type package uses inline types.
2+
# The google-apps-script-type-slides package uses inline types.

packages/google-apps-script-type/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-apps-script-type/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

packages/google-cloud-contentwarehouse/.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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
17+
__version__ = "0.2.0" # {x-release-please-version}

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/services/document_link_service/async_client.py

Lines changed: 9 additions & 13 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.contentwarehouse_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 list_linked_targets(
232233
*,
233234
parent: Optional[str] = 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
) -> document_link_service.ListLinkedTargetsResponse:
238239
r"""Return all target document-links from the document.
@@ -337,7 +338,7 @@ async def list_linked_sources(
337338
*,
338339
parent: Optional[str] = None,
339340
retry: OptionalRetry = gapic_v1.method.DEFAULT,
340-
timeout: Optional[float] = None,
341+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
341342
metadata: Sequence[Tuple[str, str]] = (),
342343
) -> pagers.ListLinkedSourcesAsyncPager:
343344
r"""Return all source document-links from the document.
@@ -456,7 +457,7 @@ async def create_document_link(
456457
parent: Optional[str] = None,
457458
document_link: Optional[document_link_service.DocumentLink] = None,
458459
retry: OptionalRetry = gapic_v1.method.DEFAULT,
459-
timeout: Optional[float] = None,
460+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
460461
metadata: Sequence[Tuple[str, str]] = (),
461462
) -> document_link_service.DocumentLink:
462463
r"""Create a link between a source document and a target
@@ -571,7 +572,7 @@ async def delete_document_link(
571572
*,
572573
name: Optional[str] = None,
573574
retry: OptionalRetry = gapic_v1.method.DEFAULT,
574-
timeout: Optional[float] = None,
575+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
575576
metadata: Sequence[Tuple[str, str]] = (),
576577
) -> None:
577578
r"""Remove the link between the source and target
@@ -664,14 +665,9 @@ async def __aexit__(self, exc_type, exc, tb):
664665
await self.transport.close()
665666

666667

667-
try:
668-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
669-
gapic_version=pkg_resources.get_distribution(
670-
"google-cloud-contentwarehouse",
671-
).version,
672-
)
673-
except pkg_resources.DistributionNotFound:
674-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
668+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
669+
gapic_version=package_version.__version__
670+
)
675671

676672

677673
__all__ = ("DocumentLinkServiceAsyncClient",)

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/services/document_link_service/client.py

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -478,7 +479,7 @@ def list_linked_targets(
478479
*,
479480
parent: Optional[str] = None,
480481
retry: OptionalRetry = gapic_v1.method.DEFAULT,
481-
timeout: Optional[float] = None,
482+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
482483
metadata: Sequence[Tuple[str, str]] = (),
483484
) -> document_link_service.ListLinkedTargetsResponse:
484485
r"""Return all target document-links from the document.
@@ -583,7 +584,7 @@ def list_linked_sources(
583584
*,
584585
parent: Optional[str] = None,
585586
retry: OptionalRetry = gapic_v1.method.DEFAULT,
586-
timeout: Optional[float] = None,
587+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
587588
metadata: Sequence[Tuple[str, str]] = (),
588589
) -> pagers.ListLinkedSourcesPager:
589590
r"""Return all source document-links from the document.
@@ -702,7 +703,7 @@ def create_document_link(
702703
parent: Optional[str] = None,
703704
document_link: Optional[document_link_service.DocumentLink] = None,
704705
retry: OptionalRetry = gapic_v1.method.DEFAULT,
705-
timeout: Optional[float] = None,
706+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
706707
metadata: Sequence[Tuple[str, str]] = (),
707708
) -> document_link_service.DocumentLink:
708709
r"""Create a link between a source document and a target
@@ -817,7 +818,7 @@ def delete_document_link(
817818
*,
818819
name: Optional[str] = None,
819820
retry: OptionalRetry = gapic_v1.method.DEFAULT,
820-
timeout: Optional[float] = None,
821+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
821822
metadata: Sequence[Tuple[str, str]] = (),
822823
) -> None:
823824
r"""Remove the link between the source and target
@@ -917,14 +918,9 @@ def __exit__(self, type, value, traceback):
917918
self.transport.close()
918919

919920

920-
try:
921-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
922-
gapic_version=pkg_resources.get_distribution(
923-
"google-cloud-contentwarehouse",
924-
).version,
925-
)
926-
except pkg_resources.DistributionNotFound:
927-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
921+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
922+
gapic_version=package_version.__version__
923+
)
928924

929925

930926
__all__ = ("DocumentLinkServiceClient",)

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/services/document_link_service/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@
2525
from google.longrunning import operations_pb2
2626
from google.oauth2 import service_account # type: ignore
2727
from google.protobuf import empty_pb2 # type: ignore
28-
import pkg_resources
2928

29+
from google.cloud.contentwarehouse_v1 import gapic_version as package_version
3030
from google.cloud.contentwarehouse_v1.types import document_link_service
3131

32-
try:
33-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
34-
gapic_version=pkg_resources.get_distribution(
35-
"google-cloud-contentwarehouse",
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 DocumentLinkServiceTransport(abc.ABC):

packages/google-cloud-contentwarehouse/google/cloud/contentwarehouse_v1/services/document_schema_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.contentwarehouse_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -238,7 +239,7 @@ async def create_document_schema(
238239
parent: Optional[str] = None,
239240
document_schema: Optional[gcc_document_schema.DocumentSchema] = None,
240241
retry: OptionalRetry = gapic_v1.method.DEFAULT,
241-
timeout: Optional[float] = None,
242+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
242243
metadata: Sequence[Tuple[str, str]] = (),
243244
) -> gcc_document_schema.DocumentSchema:
244245
r"""Creates a document schema.
@@ -354,7 +355,7 @@ async def update_document_schema(
354355
name: Optional[str] = None,
355356
document_schema: Optional[gcc_document_schema.DocumentSchema] = None,
356357
retry: OptionalRetry = gapic_v1.method.DEFAULT,
357-
timeout: Optional[float] = None,
358+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
358359
metadata: Sequence[Tuple[str, str]] = (),
359360
) -> gcc_document_schema.DocumentSchema:
360361
r"""Updates a Document Schema. Returns INVALID_ARGUMENT if the name
@@ -478,7 +479,7 @@ async def get_document_schema(
478479
*,
479480
name: Optional[str] = None,
480481
retry: OptionalRetry = gapic_v1.method.DEFAULT,
481-
timeout: Optional[float] = None,
482+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
482483
metadata: Sequence[Tuple[str, str]] = (),
483484
) -> document_schema.DocumentSchema:
484485
r"""Gets a document schema. Returns NOT_FOUND if the document schema
@@ -592,7 +593,7 @@ async def delete_document_schema(
592593
*,
593594
name: Optional[str] = None,
594595
retry: OptionalRetry = gapic_v1.method.DEFAULT,
595-
timeout: Optional[float] = None,
596+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
596597
metadata: Sequence[Tuple[str, str]] = (),
597598
) -> None:
598599
r"""Deletes a document schema. Returns NOT_FOUND if the document
@@ -686,7 +687,7 @@ async def list_document_schemas(
686687
*,
687688
parent: Optional[str] = None,
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
) -> pagers.ListDocumentSchemasAsyncPager:
692693
r"""Lists document schemas.
@@ -812,14 +813,9 @@ async def __aexit__(self, exc_type, exc, tb):
812813
await self.transport.close()
813814

814815

815-
try:
816-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
817-
gapic_version=pkg_resources.get_distribution(
818-
"google-cloud-contentwarehouse",
819-
).version,
820-
)
821-
except pkg_resources.DistributionNotFound:
822-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
816+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
817+
gapic_version=package_version.__version__
818+
)
823819

824820

825821
__all__ = ("DocumentSchemaServiceAsyncClient",)

0 commit comments

Comments
 (0)