From 9e2789a208d58221292873b0095ae4e8a924a703 Mon Sep 17 00:00:00 2001 From: ohmayr Date: Wed, 30 Oct 2024 13:49:10 -0400 Subject: [PATCH] fix: remove base class to avoid type conflict (#1619) * fix: remove base class to avoid type conflict * remove unused import * disable coverage --- .coveragerc | 2 ++ google/auth/transport/_requests_base.py | 3 ++- google/auth/transport/requests.py | 5 ++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.coveragerc b/.coveragerc index 9ba3d3fe6..4192b8cf8 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,6 +6,8 @@ omit = */samples/* */conftest.py */google-cloud-sdk/lib/* + # NOTE: Temporarily disabling coverage for `_requests_base.py`. + */_requests_base.py exclude_lines = # Re-enable the standard pragma pragma: NO COVER diff --git a/google/auth/transport/_requests_base.py b/google/auth/transport/_requests_base.py index ec718d909..0608223d8 100644 --- a/google/auth/transport/_requests_base.py +++ b/google/auth/transport/_requests_base.py @@ -13,7 +13,8 @@ # limitations under the License. """Transport adapter for Base Requests.""" - +# NOTE: The coverage for this file is temporarily disabled in `.coveragerc` +# since it is currently unused. import abc diff --git a/google/auth/transport/requests.py b/google/auth/transport/requests.py index 68f67c59b..23a69783d 100644 --- a/google/auth/transport/requests.py +++ b/google/auth/transport/requests.py @@ -38,7 +38,6 @@ from google.auth import exceptions from google.auth import transport import google.auth.transport._mtls_helper -from google.auth.transport._requests_base import _BaseAuthorizedSession from google.oauth2 import service_account _LOGGER = logging.getLogger(__name__) @@ -293,7 +292,7 @@ def proxy_manager_for(self, *args, **kwargs): return super(_MutualTlsOffloadAdapter, self).proxy_manager_for(*args, **kwargs) -class AuthorizedSession(requests.Session, _BaseAuthorizedSession): +class AuthorizedSession(requests.Session): """A Requests Session class with credentials. This class is used to perform requests to API endpoints that require @@ -390,7 +389,7 @@ def __init__( default_host=None, ): super(AuthorizedSession, self).__init__() - _BaseAuthorizedSession.__init__(self, credentials) + self.credentials = credentials self._refresh_status_codes = refresh_status_codes self._max_refresh_attempts = max_refresh_attempts self._refresh_timeout = refresh_timeout