Skip to content

Commit fa33be7

Browse files
yoshi-automationbusunkim96
authored andcommitted
docs(grafeas): add 2.7 deprecation warning (via synth) (#10042)
1 parent 55944f6 commit fa33be7

File tree

3 files changed

+3696
-23
lines changed

3 files changed

+3696
-23
lines changed

grafeas/grafeas/grafeas_v1/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,23 @@
1616

1717

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

2022
from grafeas.grafeas_v1 import types
2123
from grafeas.grafeas_v1.gapic import enums
2224
from grafeas.grafeas_v1.gapic import grafeas_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 GrafeasClient(grafeas_client.GrafeasClient):
2637
__doc__ = grafeas_client.GrafeasClient.__doc__
2738
enums = enums

grafeas/grafeas/grafeas_v1/gapic/grafeas_client.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,14 @@ class GrafeasClient(object):
6767

6868
@classmethod
6969
def note_path(cls, project, note):
70-
"""DEPRECATED. Return a fully-qualified note string."""
71-
warnings.warn(
72-
"Resource name helper functions are deprecated.",
73-
PendingDeprecationWarning,
74-
stacklevel=1,
75-
)
70+
"""Return a fully-qualified note string."""
7671
return google.api_core.path_template.expand(
7772
"projects/{project}/notes/{note}", project=project, note=note,
7873
)
7974

8075
@classmethod
8176
def occurrence_path(cls, project, occurrence):
82-
"""DEPRECATED. Return a fully-qualified occurrence string."""
83-
warnings.warn(
84-
"Resource name helper functions are deprecated.",
85-
PendingDeprecationWarning,
86-
stacklevel=1,
87-
)
77+
"""Return a fully-qualified occurrence string."""
8878
return google.api_core.path_template.expand(
8979
"projects/{project}/occurrences/{occurrence}",
9080
project=project,
@@ -93,12 +83,7 @@ def occurrence_path(cls, project, occurrence):
9383

9484
@classmethod
9585
def project_path(cls, project):
96-
"""DEPRECATED. Return a fully-qualified project string."""
97-
warnings.warn(
98-
"Resource name helper functions are deprecated.",
99-
PendingDeprecationWarning,
100-
stacklevel=1,
101-
)
86+
"""Return a fully-qualified project string."""
10287
return google.api_core.path_template.expand(
10388
"projects/{project}", project=project,
10489
)

0 commit comments

Comments
 (0)