diff --git a/packages/google-auth/CONTRIBUTING.rst b/packages/google-auth/CONTRIBUTING.rst index a186da7d44a1..ad58d7896233 100644 --- a/packages/google-auth/CONTRIBUTING.rst +++ b/packages/google-auth/CONTRIBUTING.rst @@ -19,7 +19,7 @@ A few notes on making changes to ``google-auth-library-python``. using ``nox -s docs``. - The change must work fully on the following CPython versions: - 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 across macOS, Linux, and Windows. + 3.10, 3.11, 3.12, 3.13 and 3.14 across macOS, Linux, and Windows. - The codebase *must* have 100% test statement coverage after each commit. You can test coverage via ``nox -e cover``. diff --git a/packages/google-auth/README.rst b/packages/google-auth/README.rst index 45da8044ddc7..f160ef818979 100644 --- a/packages/google-auth/README.rst +++ b/packages/google-auth/README.rst @@ -35,18 +35,7 @@ Note that the extras pyopenssl and enterprise_cert should not be used together b Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.8 - -**NOTE**: -Python 3.8 and Python 3.9 were marked as `unsupported`_ by the python community in -October 2024 and October 2025, respectively. -We recommend that all developers upgrade to Python 3.10 and newer as soon as -they can. Support for end-of-life Python runtimes will be removed from this -library in future updates. -Previous releases that support end-of-life Python versions will continue to be available -for download, but future releases will only target supported versions. - -.. _unsupported: https://devguide.python.org/versions/#unsupported-versions +Python >= 3.10 Unsupported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/google-auth/google/auth/__init__.py b/packages/google-auth/google/auth/__init__.py index c6b75f9e24a6..927efdd9f807 100644 --- a/packages/google-auth/google/auth/__init__.py +++ b/packages/google-auth/google/auth/__init__.py @@ -15,8 +15,6 @@ """Google Auth Library for Python.""" import logging -import sys -import warnings from google.auth import version as google_auth_version from google.auth._default import ( @@ -32,26 +30,5 @@ __all__ = ["default", "load_credentials_from_file", "load_credentials_from_dict"] -class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER - """ - Deprecation warning raised when Python 3.7 runtime is detected. - Python 3.7 support will be dropped after January 1, 2024. - """ - - pass - - -# Raise warnings for deprecated versions -eol_message = ( - "You are using a Python version {} past its end of life. Google will update " - "google-auth with critical bug fixes on a best-effort basis, but not " - "with any other fixes or features. Please upgrade your Python version, " - "and then update google-auth." -) -if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER - warnings.warn(eol_message.format("3.8"), FutureWarning) -elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER - warnings.warn(eol_message.format("3.9"), FutureWarning) - # Set default logging handler to avoid "No handler found" warnings. logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/packages/google-auth/google/oauth2/__init__.py b/packages/google-auth/google/oauth2/__init__.py index 56c2e629a191..4fb71fd1ad3b 100644 --- a/packages/google-auth/google/oauth2/__init__.py +++ b/packages/google-auth/google/oauth2/__init__.py @@ -13,28 +13,3 @@ # limitations under the License. """Google OAuth 2.0 Library for Python.""" - -import sys -import warnings - - -class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER - """ - Deprecation warning raised when Python 3.7 runtime is detected. - Python 3.7 support will be dropped after January 1, 2024. - """ - - pass - - -# Raise warnings for deprecated versions -eol_message = ( - "You are using a Python version {} past its end of life. Google will update " - "google-auth with critical bug fixes on a best-effort basis, but not " - "with any other fixes or features. Please upgrade your Python version, " - "and then update google-auth." -) -if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER - warnings.warn(eol_message.format("3.8"), FutureWarning) -elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER - warnings.warn(eol_message.format("3.9"), FutureWarning) diff --git a/packages/google-auth/noxfile.py b/packages/google-auth/noxfile.py index ca829fa96030..a997b2079a5d 100644 --- a/packages/google-auth/noxfile.py +++ b/packages/google-auth/noxfile.py @@ -33,8 +33,6 @@ DEFAULT_PYTHON_VERSION = "3.14" UNIT_TEST_PYTHON_VERSIONS = [ - "3.8", - "3.9", "3.10", "3.11", "3.12", @@ -42,7 +40,6 @@ "3.14", ] ALL_PYTHON = UNIT_TEST_PYTHON_VERSIONS.copy() -ALL_PYTHON.extend(["3.7"]) # Error if a python version is missing nox.options.error_on_missing_interpreters = True @@ -119,8 +116,6 @@ def mypy(session): def unit(session, install_deprecated_extras): # Install all test dependencies, then install this package in-place. - if session.python in ("3.7",): - session.skip("Python 3.7 is no longer supported") min_py, max_py = UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1] if not install_deprecated_extras and session.python not in (min_py, max_py): # only run double tests on first and last supported versions diff --git a/packages/google-auth/setup.py b/packages/google-auth/setup.py index 8a66b7c39d0e..7255dbd41313 100644 --- a/packages/google-auth/setup.py +++ b/packages/google-auth/setup.py @@ -29,7 +29,7 @@ requests_extra_require = ["requests >= 2.20.0, < 3.0.0"] -aiohttp_extra_require = ["aiohttp >= 3.6.2, < 4.0.0", *requests_extra_require] +aiohttp_extra_require = ["aiohttp >= 3.8.0, < 4.0.0", *requests_extra_require] pyjwt_extra_require = ["pyjwt>=2.0"] @@ -112,13 +112,11 @@ package_data={"google.auth": ["py.typed"], "google.oauth2": ["py.typed"]}, install_requires=DEPENDENCIES, extras_require=extras, - python_requires=">=3.8", + python_requires=">=3.10", license="Apache 2.0", keywords="google auth oauth client", classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/packages/google-auth/testing/constraints-3.10.txt b/packages/google-auth/testing/constraints-3.10.txt index b9cf106f0cc2..31094f0391cb 100644 --- a/packages/google-auth/testing/constraints-3.10.txt +++ b/packages/google-auth/testing/constraints-3.10.txt @@ -1 +1,13 @@ -urllib3<2.0.0 \ No newline at end of file +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List *all* library dependencies and extras in this file. +# Pin the version to the lower bound. +# +# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", +# Then this file should have foo==1.14.0 +pyasn1-modules==0.2.1 +setuptools==40.3.0 +cryptography==38.0.3 +aiohttp==3.8.0 +requests==2.20.0 +pyjwt==2.0 \ No newline at end of file diff --git a/packages/google-auth/testing/constraints-3.8.txt b/packages/google-auth/testing/constraints-3.8.txt deleted file mode 100644 index 3ca0e8edb179..000000000000 --- a/packages/google-auth/testing/constraints-3.8.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List *all* library dependencies and extras in this file. -# Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -pyasn1-modules==0.2.1 -setuptools==40.3.0 -cryptography==38.0.3 -aiohttp==3.6.2 -requests==2.20.0 -pyjwt==2.0 \ No newline at end of file diff --git a/packages/google-auth/testing/constraints-3.9.txt b/packages/google-auth/testing/constraints-3.9.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/google-auth/tests/test_version_warnings.py b/packages/google-auth/tests/test_version_warnings.py deleted file mode 100644 index d975221c43f4..000000000000 --- a/packages/google-auth/tests/test_version_warnings.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import importlib -import sys -from unittest import mock -import warnings - -import pytest - -import google.auth -import google.oauth2 - - -@pytest.mark.parametrize("module", [google.auth, google.oauth2]) -@pytest.mark.parametrize( - "version, expected_warning", - [ - ((3, 8), True), - ((3, 9), True), - ((3, 10), False), - ((3, 13), False), - ], -) -def test_python_version_warnings(module, version, expected_warning): - # Mock sys.version_info - # We use a MagicMock that has major and minor attributes - mock_version = mock.Mock() - mock_version.major = version[0] - mock_version.minor = version[1] - - with mock.patch.object(sys, "version_info", mock_version): - with warnings.catch_warnings(record=True) as caught_warnings: - warnings.simplefilter("always") - importlib.reload(module) - - future_warnings = [ - w - for w in caught_warnings - if issubclass(w.category, FutureWarning) - and "past its end of life" in str(w.message) - ] - - if expected_warning: - assert ( - len(future_warnings) > 0 - ), f"Expected FutureWarning for Python {version} in {module.__name__}" - assert str(version[1]) in str(future_warnings[0].message) - else: - assert ( - len(future_warnings) == 0 - ), f"Did not expect FutureWarning for Python {version} in {module.__name__}"