Skip to content

Commit 0a3434e

Browse files
committed
Fix mypy failures
1 parent f74b794 commit 0a3434e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

google/api_core/_python_version_support.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import logging
2020
import sys
2121
import textwrap
22-
from typing import NamedTuple, Optional, Dict, Tuple
22+
from typing import Any, NamedTuple, Optional, Dict, Tuple
2323

2424

2525
class PythonVersionStatus(enum.Enum):
@@ -126,7 +126,7 @@ def _get_pypi_package_name(module_name):
126126
return None
127127

128128

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]:
130130
"""Return a pretty string with distribution & import package names."""
131131
distribution_package = _get_pypi_package_name(import_package)
132132
dependency_distribution_and_import_packages = (
@@ -138,7 +138,7 @@ def _get_distribution_and_import_packages(import_package: str) -> Optional[str]:
138138

139139

140140
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
142142
) -> PythonVersionStatus:
143143
"""Check the running Python version and issue a support warning if needed.
144144
@@ -188,7 +188,7 @@ def min_python(date: datetime.date) -> str:
188188
f"""
189189
You are using a non-supported Python version
190190
({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
192192
latest Python version, or at least Python
193193
{min_python(today)}, and then update {package_label}.
194194
"""
@@ -203,7 +203,7 @@ def min_python(date: datetime.date) -> str:
203203
You are using a Python version ({py_version_str})
204204
past its end of life. Google will update {package_label}
205205
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
207207
to the latest Python version, or at least Python
208208
{min_python(today)}, and then update {package_label}.
209209
"""
@@ -214,10 +214,10 @@ def min_python(date: datetime.date) -> str:
214214
if gapic_deprecation <= today <= gapic_end:
215215
message = _flatten_message(
216216
f"""
217-
You are using a Python version ({py_version_str}),
217+
You are using a Python version ({py_version_str})
218218
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
221221
least Python {min_python(version_info.python_eol)}, and
222222
then update {package_label}.
223223
"""

0 commit comments

Comments
 (0)