Repository navigation
feat(core): add runtime Python version support warning for EoL versions - #998
Open
lahirumaramba wants to merge 3 commits into
Open
lahirumaramba wants to merge 3 commits into
lahirumaramba wants to merge 3 commits into
Conversation
Add _python_version_support module (adapted from google-api-core) and invoke check_python_version(package='firebase-admin') at package import time to emit a FutureWarning on deprecated and End-of-Life Python versions (<= 3.10).
Remove dynamic package metadata lookup and unused GAPIC fields from VersionInfo, and start the EoL warning window on python_eol.
There was a problem hiding this comment.
Code Review
This pull request introduces a Python version support checking mechanism for the Firebase Admin Python SDK. It adds a new module _python_version_support.py that checks the running Python version against a list of tracked versions and issues deprecation, end-of-life, or unsupported warnings accordingly. The README.md is updated to reflect that Python 3.9 and 3.10 support is deprecated, and comprehensive tests are added in tests/test_python_version_support.py. The review feedback suggests improving the warning attribution by adding stacklevel=2 to the warnings.warn calls, and refactoring the min_python helper function to avoid grammatically awkward fallback messages.
Add stacklevel=2 to FutureWarning calls in check_python_version and include the 'Python' prefix in min_python() so the fallback wording reads naturally.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the policy to drop End-of-Life (EoL) Python versions in minor releases, aligning
firebase-adminwith Google Cloud Python client libraries andgoogle-api-core.Adds
firebase_admin/_python_version_support.py(adapted fromgoogle.api_core._python_version_support) and invokescheck_python_version()once at package import time infirebase_admin/__init__.py.Key Changes
firebase_admin/_python_version_support.py):google-api-corelifecycle defaults (deprecation_date = python_eol - 1 year,end_of_support_date = python_eol + 1 week) with no custom grace overrides.VersionInfoentry for Python3.9(PSF EoL2025-10-05) alongside Python3.10–3.14so that the warning recommends upgrading to at least Python3.11. With defaultend_of_support_date, both Python3.9and3.10(both past EoL) emit thePYTHON_VERSION_UNSUPPORTEDFutureWarning("You are using a non-supported Python version... upgrade to at least Python 3.11"), matching the upcoming removal of both3.9and3.10in the next minor release.FutureWarning(rather thanDeprecationWarning, which Python hides by default outside__main__) so developers see the warning in logs when importingfirebase_admin.firebase_admin/__init__.py(_python_version_support.check_python_version()).README.md):Supported Python Versionssection to note that Python 3.9 and 3.10 support is deprecated and will be dropped in an upcoming minor release, and recommends Python 3.11 or higher.tests/test_python_version_support.py):today=parameter) covering Python3.9,3.10, supported versions (3.11–3.14), untracked older (3.8) and future (3.15,40.0) versions, anddeprecation_date/end_of_support_dateoverrides.Proposed Release Note