Skip to content

Commit 4f27a60

Browse files
committed
fix(core): make deprecation warning message EoL-agnostic
Drop 'has reached its end of life' from the FutureWarning text so bumping _MIN_NON_DEPRECATED_VERSION works for both pre-EoL and post-EoL deprecations.
1 parent 500dc2b commit 4f27a60

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

‎firebase_admin/_python_version_support.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
import warnings
1919

2020
# Minimum Python (major, minor) version that does not emit a deprecation warning.
21-
# Bump this tuple in a minor release when a supported Python version reaches
22-
# End-of-Life (https://devguide.python.org/versions/), before dropping it in a
23-
# subsequent release.
21+
# Bump this tuple in a minor release to deprecate an older Python version ahead
22+
# of dropping it in a future release.
2423
_MIN_NON_DEPRECATED_VERSION = (3, 11)
2524

2625

@@ -33,10 +32,9 @@ def check_python_version() -> None:
3332
f'{_MIN_NON_DEPRECATED_VERSION[0]}.{_MIN_NON_DEPRECATED_VERSION[1]}'
3433
)
3534
warnings.warn(
36-
f'Python {current_str} has reached its end of life. Support for '
37-
f'Python {current_str} in firebase-admin is deprecated and will be '
38-
'dropped in an upcoming minor release. Please upgrade to Python '
39-
f'{recommended_str} or higher to continue receiving updates.',
35+
f'Support for Python {current_str} in firebase-admin is deprecated '
36+
'and will be dropped in a future minor release. Please upgrade to '
37+
f'Python {recommended_str} or higher to continue receiving updates.',
4038
FutureWarning,
4139
stacklevel=2,
4240
)

‎tests/test_python_version_support.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ def test_deprecated_python_versions_emit_future_warning(version_tuple):
3737
assert len(record) == 1
3838
assert record[0].filename == __file__
3939
expected = (
40-
f'Python {version_str} has reached its end of life. Support for '
41-
f'Python {version_str} in firebase-admin is deprecated and will be '
42-
'dropped in an upcoming minor release. Please upgrade to Python '
43-
'3.11 or higher to continue receiving updates.'
40+
f'Support for Python {version_str} in firebase-admin is deprecated '
41+
'and will be dropped in a future minor release. Please upgrade to '
42+
'Python 3.11 or higher to continue receiving updates.'
4443
)
4544
assert str(record[0].message) == expected
4645

0 commit comments

Comments
 (0)