Skip to content

Commit b270311

Browse files
docs(webrisk): add 2.7 deprecation warning; bump copyright year to 2020; use templated noxfile (via synth) (#10053)
1 parent 906e5fa commit b270311

15 files changed

+210
-124
lines changed

webrisk/docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
u"google-cloud-webrisk Documentation",
265265
author,
266266
"manual",
267-
),
267+
)
268268
]
269269

270270
# The name of an image file (relative to this directory) to place at the top of
@@ -320,7 +320,7 @@
320320
"google-cloud-webrisk",
321321
"GAPIC library for the {metadata.shortName} v1beta1 service",
322322
"APIs",
323-
),
323+
)
324324
]
325325

326326
# Documents to append as an appendix to all manuals.

webrisk/google/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

webrisk/google/cloud/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

webrisk/google/cloud/webrisk.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -22,8 +22,4 @@
2222
from google.cloud.webrisk_v1beta1 import types
2323

2424

25-
__all__ = (
26-
"enums",
27-
"types",
28-
"WebRiskServiceV1Beta1Client",
29-
)
25+
__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client")

webrisk/google/cloud/webrisk_v1beta1/__init__.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,21 +16,28 @@
1616

1717

1818
from __future__ import absolute_import
19+
import sys
20+
import warnings
1921

2022
from google.cloud.webrisk_v1beta1 import types
2123
from google.cloud.webrisk_v1beta1.gapic import enums
2224
from google.cloud.webrisk_v1beta1.gapic import web_risk_service_v1_beta1_client
2325

2426

27+
if sys.version_info[:2] == (2, 7):
28+
message = (
29+
"A future version of this library will drop support for Python 2.7."
30+
"More details about Python 2 support for Google Cloud Client Libraries"
31+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
32+
)
33+
warnings.warn(message, DeprecationWarning)
34+
35+
2536
class WebRiskServiceV1Beta1Client(
2637
web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client
2738
):
2839
__doc__ = web_risk_service_v1_beta1_client.WebRiskServiceV1Beta1Client.__doc__
2940
enums = enums
3041

3142

32-
__all__ = (
33-
"enums",
34-
"types",
35-
"WebRiskServiceV1Beta1Client",
36-
)
43+
__all__ = ("enums", "types", "WebRiskServiceV1Beta1Client")

webrisk/google/cloud/webrisk_v1beta1/gapic/enums.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

webrisk/google/cloud/webrisk_v1beta1/gapic/transports/web_risk_service_v1_beta1_grpc_transport.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ def __init__(
5353
# exception (channels come with credentials baked in already).
5454
if channel is not None and credentials is not None:
5555
raise ValueError(
56-
"The `channel` and `credentials` arguments are mutually " "exclusive.",
56+
"The `channel` and `credentials` arguments are mutually " "exclusive."
5757
)
5858

5959
# Create the channel.
@@ -74,7 +74,7 @@ def __init__(
7474
self._stubs = {
7575
"web_risk_service_v1_beta1_stub": webrisk_pb2_grpc.WebRiskServiceV1Beta1Stub(
7676
channel
77-
),
77+
)
7878
}
7979

8080
@classmethod

webrisk/google/cloud/webrisk_v1beta1/gapic/web_risk_service_v1_beta1_client.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@
3636
from google.cloud.webrisk_v1beta1.proto import webrisk_pb2_grpc
3737

3838

39-
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-webrisk",).version
39+
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-webrisk").version
4040

4141

4242
class WebRiskServiceV1Beta1Client(object):
@@ -159,12 +159,12 @@ def __init__(
159159
self.transport = transport
160160
else:
161161
self.transport = web_risk_service_v1_beta1_grpc_transport.WebRiskServiceV1Beta1GrpcTransport(
162-
address=api_endpoint, channel=channel, credentials=credentials,
162+
address=api_endpoint, channel=channel, credentials=credentials
163163
)
164164

165165
if client_info is None:
166166
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
167-
gapic_version=_GAPIC_LIBRARY_VERSION,
167+
gapic_version=_GAPIC_LIBRARY_VERSION
168168
)
169169
else:
170170
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
@@ -175,7 +175,7 @@ def __init__(
175175
# (Ordinarily, these are the defaults specified in the `*_config.py`
176176
# file next to this one.)
177177
self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
178-
client_config["interfaces"][self._INTERFACE_NAME],
178+
client_config["interfaces"][self._INTERFACE_NAME]
179179
)
180180

181181
# Save a dictionary of cached API call functions.
@@ -316,7 +316,7 @@ def search_uris(
316316
client_info=self._client_info,
317317
)
318318

319-
request = webrisk_pb2.SearchUrisRequest(uri=uri, threat_types=threat_types,)
319+
request = webrisk_pb2.SearchUrisRequest(uri=uri, threat_types=threat_types)
320320
return self._inner_api_calls["search_uris"](
321321
request, retry=retry, timeout=timeout, metadata=metadata
322322
)
@@ -382,7 +382,7 @@ def search_hashes(
382382
)
383383

384384
request = webrisk_pb2.SearchHashesRequest(
385-
threat_types=threat_types, hash_prefix=hash_prefix,
385+
threat_types=threat_types, hash_prefix=hash_prefix
386386
)
387387
return self._inner_api_calls["search_hashes"](
388388
request, retry=retry, timeout=timeout, metadata=metadata

webrisk/google/cloud/webrisk_v1beta1/proto/webrisk_pb2.py

+21-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webrisk/google/cloud/webrisk_v1beta1/types.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2019 Google LLC
3+
# Copyright 2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -24,13 +24,9 @@
2424
from google.protobuf import timestamp_pb2
2525

2626

27-
_shared_modules = [
28-
timestamp_pb2,
29-
]
27+
_shared_modules = [timestamp_pb2]
3028

31-
_local_modules = [
32-
webrisk_pb2,
33-
]
29+
_local_modules = [webrisk_pb2]
3430

3531
names = []
3632

0 commit comments

Comments
 (0)