Skip to content

Commit 7e4d762

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#388)
* 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 6b880ca commit 7e4d762

File tree

32 files changed

+193
-191
lines changed

32 files changed

+193
-191
lines changed

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

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/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.videointelligence_v1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def annotate_video(
225226
input_uri: Optional[str] = None,
226227
features: Optional[MutableSequence[video_intelligence.Feature]] = None,
227228
retry: OptionalRetry = gapic_v1.method.DEFAULT,
228-
timeout: Optional[float] = None,
229+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
229230
metadata: Sequence[Tuple[str, str]] = (),
230231
) -> operation_async.AsyncOperation:
231232
r"""Performs asynchronous video annotation. Progress and results can
@@ -259,7 +260,7 @@ async def sample_annotate_video():
259260
260261
print("Waiting for operation to complete...")
261262
262-
response = await operation.result()
263+
response = (await operation).result()
263264
264265
# Handle the response
265266
print(response)
@@ -371,14 +372,9 @@ async def __aexit__(self, exc_type, exc, tb):
371372
await self.transport.close()
372373

373374

374-
try:
375-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
376-
gapic_version=pkg_resources.get_distribution(
377-
"google-cloud-videointelligence",
378-
).version,
379-
)
380-
except pkg_resources.DistributionNotFound:
381-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
375+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
376+
gapic_version=package_version.__version__
377+
)
382378

383379

384380
__all__ = ("VideoIntelligenceServiceAsyncClient",)

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_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.videointelligence_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -427,7 +428,7 @@ def annotate_video(
427428
input_uri: Optional[str] = None,
428429
features: Optional[MutableSequence[video_intelligence.Feature]] = None,
429430
retry: OptionalRetry = gapic_v1.method.DEFAULT,
430-
timeout: Optional[float] = None,
431+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
431432
metadata: Sequence[Tuple[str, str]] = (),
432433
) -> operation.Operation:
433434
r"""Performs asynchronous video annotation. Progress and results can
@@ -570,14 +571,9 @@ def __exit__(self, type, value, traceback):
570571
self.transport.close()
571572

572573

573-
try:
574-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
575-
gapic_version=pkg_resources.get_distribution(
576-
"google-cloud-videointelligence",
577-
).version,
578-
)
579-
except pkg_resources.DistributionNotFound:
580-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
574+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
575+
gapic_version=package_version.__version__
576+
)
581577

582578

583579
__all__ = ("VideoIntelligenceServiceClient",)

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1/services/video_intelligence_service/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.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.videointelligence_v1 import gapic_version as package_version
2929
from google.cloud.videointelligence_v1.types import video_intelligence
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-videointelligence",
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 VideoIntelligenceServiceTransport(abc.ABC):
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.8.3" # {x-release-please-version}

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/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.videointelligence_v1beta2 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def annotate_video(
225226
input_uri: Optional[str] = None,
226227
features: Optional[MutableSequence[video_intelligence.Feature]] = None,
227228
retry: OptionalRetry = gapic_v1.method.DEFAULT,
228-
timeout: Optional[float] = None,
229+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
229230
metadata: Sequence[Tuple[str, str]] = (),
230231
) -> operation_async.AsyncOperation:
231232
r"""Performs asynchronous video annotation. Progress and results can
@@ -259,7 +260,7 @@ async def sample_annotate_video():
259260
260261
print("Waiting for operation to complete...")
261262
262-
response = await operation.result()
263+
response = (await operation).result()
263264
264265
# Handle the response
265266
print(response)
@@ -371,14 +372,9 @@ async def __aexit__(self, exc_type, exc, tb):
371372
await self.transport.close()
372373

373374

374-
try:
375-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
376-
gapic_version=pkg_resources.get_distribution(
377-
"google-cloud-videointelligence",
378-
).version,
379-
)
380-
except pkg_resources.DistributionNotFound:
381-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
375+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
376+
gapic_version=package_version.__version__
377+
)
382378

383379

384380
__all__ = ("VideoIntelligenceServiceAsyncClient",)

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_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.videointelligence_v1beta2 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -427,7 +428,7 @@ def annotate_video(
427428
input_uri: Optional[str] = None,
428429
features: Optional[MutableSequence[video_intelligence.Feature]] = None,
429430
retry: OptionalRetry = gapic_v1.method.DEFAULT,
430-
timeout: Optional[float] = None,
431+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
431432
metadata: Sequence[Tuple[str, str]] = (),
432433
) -> operation.Operation:
433434
r"""Performs asynchronous video annotation. Progress and results can
@@ -570,14 +571,9 @@ def __exit__(self, type, value, traceback):
570571
self.transport.close()
571572

572573

573-
try:
574-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
575-
gapic_version=pkg_resources.get_distribution(
576-
"google-cloud-videointelligence",
577-
).version,
578-
)
579-
except pkg_resources.DistributionNotFound:
580-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
574+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
575+
gapic_version=package_version.__version__
576+
)
581577

582578

583579
__all__ = ("VideoIntelligenceServiceClient",)

packages/google-cloud-videointelligence/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/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.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
27-
import pkg_resources
2827

28+
from google.cloud.videointelligence_v1beta2 import gapic_version as package_version
2929
from google.cloud.videointelligence_v1beta2.types import video_intelligence
3030

31-
try:
32-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution(
34-
"google-cloud-videointelligence",
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 VideoIntelligenceServiceTransport(abc.ABC):
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.8.3" # {x-release-please-version}

0 commit comments

Comments
 (0)