Skip to content

Commit 31321e1

Browse files
committed
add docstring to warn_deprecation_for_versions_less_than
1 parent e5a7b1c commit 31321e1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

google/api_core/_python_package_support.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ def warn_deprecation_for_versions_less_than(
6262
next_supported_version: str,
6363
message_template: Optional[str] = None,
6464
):
65+
"""Issue a deprecation warning for outdated versions of `dependency_name`.
66+
67+
If `dependency_name` is installed at a version less than
68+
`next_supported_versions`, this issues a warning using either a
69+
default `message_template` or one provided by the user. The
70+
default `message_template informs users that they will not receive
71+
future updates `dependent_package` if `dependency_name` is somehow
72+
pinned to a version lower than `next_supported_version`.
73+
74+
Args:
75+
dependent_package: The distribution name of the package that needs `dependency_name`.
76+
dependency_name: The distribution name oft he dependency to check.
77+
next_supported_version: The version number below which a deprecation warning will be logged.
78+
message_template: A custom default message template to replace
79+
the default. This `message_template` is treated as an
80+
f-string, where the following variables are defined:
81+
`dependency_name`, `dependent_package`,
82+
`next_supported_version`, and `version_used`.
83+
"""
6584
if not dependent_package or not dependency_name or not next_supported_version:
6685
return
6786
version_used = get_dependency_version(dependency_name)

0 commit comments

Comments
 (0)