19
19
import logging
20
20
import sys
21
21
import textwrap
22
- from typing import NamedTuple , Optional , Dict , Tuple
22
+ from typing import Any , NamedTuple , Optional , Dict , Tuple
23
23
24
24
25
25
class PythonVersionStatus (enum .Enum ):
@@ -126,7 +126,7 @@ def _get_pypi_package_name(module_name):
126
126
return None
127
127
128
128
129
- def _get_distribution_and_import_packages (import_package : str ) -> Optional [str ]:
129
+ def _get_distribution_and_import_packages (import_package : str ) -> Tuple [str , Any ]:
130
130
"""Return a pretty string with distribution & import package names."""
131
131
distribution_package = _get_pypi_package_name (import_package )
132
132
dependency_distribution_and_import_packages = (
@@ -138,7 +138,7 @@ def _get_distribution_and_import_packages(import_package: str) -> Optional[str]:
138
138
139
139
140
140
def check_python_version (
141
- package : Optional [ str ] = "this package" , today : Optional [datetime .date ] = None
141
+ package : str = "this package" , today : Optional [datetime .date ] = None
142
142
) -> PythonVersionStatus :
143
143
"""Check the running Python version and issue a support warning if needed.
144
144
@@ -188,7 +188,7 @@ def min_python(date: datetime.date) -> str:
188
188
f"""
189
189
You are using a non-supported Python version
190
190
({ py_version_str } ). Google will not post any further
191
- updates to { package_label } . We suggest you upgrade to the
191
+ updates to { package_label } . Please upgrade to the
192
192
latest Python version, or at least Python
193
193
{ min_python (today )} , and then update { package_label } .
194
194
"""
@@ -203,7 +203,7 @@ def min_python(date: datetime.date) -> str:
203
203
You are using a Python version ({ py_version_str } )
204
204
past its end of life. Google will update { package_label }
205
205
with critical bug fixes on a best-effort basis, but not
206
- with any other fixes or features. We suggest you upgrade
206
+ with any other fixes or features. Please upgrade
207
207
to the latest Python version, or at least Python
208
208
{ min_python (today )} , and then update { package_label } .
209
209
"""
@@ -214,10 +214,10 @@ def min_python(date: datetime.date) -> str:
214
214
if gapic_deprecation <= today <= gapic_end :
215
215
message = _flatten_message (
216
216
f"""
217
- You are using a Python version ({ py_version_str } ),
217
+ You are using a Python version ({ py_version_str } )
218
218
which Google will stop supporting in { package_label } when
219
- it reaches its end of life ({ version_info .python_eol } ). We
220
- suggest you upgrade to the latest Python version, or at
219
+ it reaches its end of life ({ version_info .python_eol } ). Please
220
+ upgrade to the latest Python version, or at
221
221
least Python { min_python (version_info .python_eol )} , and
222
222
then update { package_label } .
223
223
"""
0 commit comments