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

Commit a0b28f9

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#83)
* 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 5a22835 commit a0b28f9

File tree

8 files changed

+37
-38
lines changed

8 files changed

+37
-38
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__ = "0.4.2" # {x-release-please-version}

google/cloud/eventarc_publishing_v1/services/publisher/async_client.py

Lines changed: 7 additions & 11 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.eventarc_publishing_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -235,7 +236,7 @@ async def publish_channel_connection_events(
235236
] = None,
236237
*,
237238
retry: OptionalRetry = gapic_v1.method.DEFAULT,
238-
timeout: Optional[float] = None,
239+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
239240
metadata: Sequence[Tuple[str, str]] = (),
240241
) -> publisher.PublishChannelConnectionEventsResponse:
241242
r"""Publish events to a ChannelConnection in a partner's
@@ -317,7 +318,7 @@ async def publish_events(
317318
request: Optional[Union[publisher.PublishEventsRequest, dict]] = None,
318319
*,
319320
retry: OptionalRetry = gapic_v1.method.DEFAULT,
320-
timeout: Optional[float] = None,
321+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
321322
metadata: Sequence[Tuple[str, str]] = (),
322323
) -> publisher.PublishEventsResponse:
323324
r"""Publish events to a subscriber's channel.
@@ -398,14 +399,9 @@ async def __aexit__(self, exc_type, exc, tb):
398399
await self.transport.close()
399400

400401

401-
try:
402-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
403-
gapic_version=pkg_resources.get_distribution(
404-
"google-cloud-eventarc-publishing",
405-
).version,
406-
)
407-
except pkg_resources.DistributionNotFound:
408-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
402+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
403+
gapic_version=package_version.__version__
404+
)
409405

410406

411407
__all__ = ("PublisherAsyncClient",)

google/cloud/eventarc_publishing_v1/services/publisher/client.py

Lines changed: 7 additions & 11 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.eventarc_publishing_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -448,7 +449,7 @@ def publish_channel_connection_events(
448449
] = None,
449450
*,
450451
retry: OptionalRetry = gapic_v1.method.DEFAULT,
451-
timeout: Optional[float] = None,
452+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
452453
metadata: Sequence[Tuple[str, str]] = (),
453454
) -> publisher.PublishChannelConnectionEventsResponse:
454455
r"""Publish events to a ChannelConnection in a partner's
@@ -533,7 +534,7 @@ def publish_events(
533534
request: Optional[Union[publisher.PublishEventsRequest, dict]] = None,
534535
*,
535536
retry: OptionalRetry = gapic_v1.method.DEFAULT,
536-
timeout: Optional[float] = None,
537+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
537538
metadata: Sequence[Tuple[str, str]] = (),
538539
) -> publisher.PublishEventsResponse:
539540
r"""Publish events to a subscriber's channel.
@@ -622,14 +623,9 @@ def __exit__(self, type, value, traceback):
622623
self.transport.close()
623624

624625

625-
try:
626-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
627-
gapic_version=pkg_resources.get_distribution(
628-
"google-cloud-eventarc-publishing",
629-
).version,
630-
)
631-
except pkg_resources.DistributionNotFound:
632-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
626+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
627+
gapic_version=package_version.__version__
628+
)
633629

634630

635631
__all__ = ("PublisherClient",)

google/cloud/eventarc_publishing_v1/services/publisher/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.eventarc_publishing_v1 import gapic_version as package_version
2828
from google.cloud.eventarc_publishing_v1.types import publisher
2929

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-eventarc-publishing",
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 PublisherTransport(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/eventarc_publishing/gapic_version.py",
8+
"google/cloud/eventarc_publishing_v1/gapic_version.py",
89
{
910
"type": "json",
1011
"path": "samples/generated_samples/snippet_metadata_google.cloud.eventarc.publishing.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
]

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)