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

Commit bd4ef44

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#244)
* 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 fa028d4 commit bd4ef44

File tree

12 files changed

+78
-75
lines changed

12 files changed

+78
-75
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__ = "1.8.4" # {x-release-please-version}

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

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -222,7 +223,7 @@ async def compute_threat_list_diff(
222223
version_token: Optional[bytes] = None,
223224
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = None,
224225
retry: OptionalRetry = gapic_v1.method.DEFAULT,
225-
timeout: Optional[float] = None,
226+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
226227
metadata: Sequence[Tuple[str, str]] = (),
227228
) -> webrisk.ComputeThreatListDiffResponse:
228229
r"""Gets the most recent threat list diffs. These diffs
@@ -361,7 +362,7 @@ async def search_uris(
361362
uri: Optional[str] = None,
362363
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
363364
retry: OptionalRetry = gapic_v1.method.DEFAULT,
364-
timeout: Optional[float] = None,
365+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
365366
metadata: Sequence[Tuple[str, str]] = (),
366367
) -> webrisk.SearchUrisResponse:
367368
r"""This method is used to check whether a URI is on a
@@ -482,7 +483,7 @@ async def search_hashes(
482483
hash_prefix: Optional[bytes] = None,
483484
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
484485
retry: OptionalRetry = gapic_v1.method.DEFAULT,
485-
timeout: Optional[float] = None,
486+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
486487
metadata: Sequence[Tuple[str, str]] = (),
487488
) -> webrisk.SearchHashesResponse:
488489
r"""Gets the full hashes that match the requested hash
@@ -607,7 +608,7 @@ async def create_submission(
607608
parent: Optional[str] = None,
608609
submission: Optional[webrisk.Submission] = None,
609610
retry: OptionalRetry = gapic_v1.method.DEFAULT,
610-
timeout: Optional[float] = None,
611+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
611612
metadata: Sequence[Tuple[str, str]] = (),
612613
) -> webrisk.Submission:
613614
r"""Creates a Submission of a URI suspected of containing phishing
@@ -733,14 +734,9 @@ async def __aexit__(self, exc_type, exc, tb):
733734
await self.transport.close()
734735

735736

736-
try:
737-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
738-
gapic_version=pkg_resources.get_distribution(
739-
"google-cloud-webrisk",
740-
).version,
741-
)
742-
except pkg_resources.DistributionNotFound:
743-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
737+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
738+
gapic_version=package_version.__version__
739+
)
744740

745741

746742
__all__ = ("WebRiskServiceAsyncClient",)

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

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -429,7 +430,7 @@ def compute_threat_list_diff(
429430
version_token: Optional[bytes] = None,
430431
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = None,
431432
retry: OptionalRetry = gapic_v1.method.DEFAULT,
432-
timeout: Optional[float] = None,
433+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
433434
metadata: Sequence[Tuple[str, str]] = (),
434435
) -> webrisk.ComputeThreatListDiffResponse:
435436
r"""Gets the most recent threat list diffs. These diffs
@@ -558,7 +559,7 @@ def search_uris(
558559
uri: Optional[str] = None,
559560
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
560561
retry: OptionalRetry = gapic_v1.method.DEFAULT,
561-
timeout: Optional[float] = None,
562+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
562563
metadata: Sequence[Tuple[str, str]] = (),
563564
) -> webrisk.SearchUrisResponse:
564565
r"""This method is used to check whether a URI is on a
@@ -669,7 +670,7 @@ def search_hashes(
669670
hash_prefix: Optional[bytes] = None,
670671
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
671672
retry: OptionalRetry = gapic_v1.method.DEFAULT,
672-
timeout: Optional[float] = None,
673+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
673674
metadata: Sequence[Tuple[str, str]] = (),
674675
) -> webrisk.SearchHashesResponse:
675676
r"""Gets the full hashes that match the requested hash
@@ -784,7 +785,7 @@ def create_submission(
784785
parent: Optional[str] = None,
785786
submission: Optional[webrisk.Submission] = None,
786787
retry: OptionalRetry = gapic_v1.method.DEFAULT,
787-
timeout: Optional[float] = None,
788+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
788789
metadata: Sequence[Tuple[str, str]] = (),
789790
) -> webrisk.Submission:
790791
r"""Creates a Submission of a URI suspected of containing phishing
@@ -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-webrisk",
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__ = ("WebRiskServiceClient",)

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

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-webrisk",
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 WebRiskServiceTransport(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__ = "1.8.4" # {x-release-please-version}

google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/async_client.py

Lines changed: 8 additions & 12 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.webrisk_v1beta1 import gapic_version as package_version
3839

3940
try:
4041
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -225,7 +226,7 @@ async def compute_threat_list_diff(
225226
version_token: Optional[bytes] = None,
226227
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = 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
) -> webrisk.ComputeThreatListDiffResponse:
231232
r"""Gets the most recent threat list diffs.
@@ -347,7 +348,7 @@ async def search_uris(
347348
uri: Optional[str] = None,
348349
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
349350
retry: OptionalRetry = gapic_v1.method.DEFAULT,
350-
timeout: Optional[float] = None,
351+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
351352
metadata: Sequence[Tuple[str, str]] = (),
352353
) -> webrisk.SearchUrisResponse:
353354
r"""This method is used to check whether a URI is on a
@@ -463,7 +464,7 @@ async def search_hashes(
463464
hash_prefix: Optional[bytes] = None,
464465
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
465466
retry: OptionalRetry = gapic_v1.method.DEFAULT,
466-
timeout: Optional[float] = None,
467+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
467468
metadata: Sequence[Tuple[str, str]] = (),
468469
) -> webrisk.SearchHashesResponse:
469470
r"""Gets the full hashes that match the requested hash
@@ -584,14 +585,9 @@ async def __aexit__(self, exc_type, exc, tb):
584585
await 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-webrisk",
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__ = ("WebRiskServiceV1Beta1AsyncClient",)

google/cloud/webrisk_v1beta1/services/web_risk_service_v1_beta1/client.py

Lines changed: 8 additions & 12 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.webrisk_v1beta1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -429,7 +430,7 @@ def compute_threat_list_diff(
429430
version_token: Optional[bytes] = None,
430431
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = None,
431432
retry: OptionalRetry = gapic_v1.method.DEFAULT,
432-
timeout: Optional[float] = None,
433+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
433434
metadata: Sequence[Tuple[str, str]] = (),
434435
) -> webrisk.ComputeThreatListDiffResponse:
435436
r"""Gets the most recent threat list diffs.
@@ -541,7 +542,7 @@ def search_uris(
541542
uri: Optional[str] = None,
542543
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
543544
retry: OptionalRetry = gapic_v1.method.DEFAULT,
544-
timeout: Optional[float] = None,
545+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
545546
metadata: Sequence[Tuple[str, str]] = (),
546547
) -> webrisk.SearchUrisResponse:
547548
r"""This method is used to check whether a URI is on a
@@ -647,7 +648,7 @@ def search_hashes(
647648
hash_prefix: Optional[bytes] = None,
648649
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
649650
retry: OptionalRetry = gapic_v1.method.DEFAULT,
650-
timeout: Optional[float] = None,
651+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
651652
metadata: Sequence[Tuple[str, str]] = (),
652653
) -> webrisk.SearchHashesResponse:
653654
r"""Gets the full hashes that match the requested hash
@@ -765,14 +766,9 @@ def __exit__(self, type, value, traceback):
765766
self.transport.close()
766767

767768

768-
try:
769-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
770-
gapic_version=pkg_resources.get_distribution(
771-
"google-cloud-webrisk",
772-
).version,
773-
)
774-
except pkg_resources.DistributionNotFound:
775-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
769+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
770+
gapic_version=package_version.__version__
771+
)
776772

777773

778774
__all__ = ("WebRiskServiceV1Beta1Client",)

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

30-
try:
31-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32-
gapic_version=pkg_resources.get_distribution(
33-
"google-cloud-webrisk",
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 WebRiskServiceV1Beta1Transport(abc.ABC):

release-please-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
".": {
55
"release-type": "python",
66
"extra-files": [
7+
"google/cloud/webrisk_v1/gapic_version.py",
8+
"google/cloud/webrisk_v1beta1/gapic_version.py",
79
"google/cloud/webrisk/gapic_version.py",
810
{
911
"type": "json",

0 commit comments

Comments
 (0)