Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 1ccbb53

Browse files
Merge branch 'main' into add_cryptography_dependency
2 parents 1edd592 + e5a28b5 commit 1ccbb53

7 files changed

Lines changed: 26 additions & 23 deletions

File tree

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-22.04
2727
strategy:
2828
matrix:
29-
python: ['3.8']
29+
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v4

google/auth/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
4242

4343

4444
# Raise warnings for deprecated versions
45-
eol_message = """
46-
You are using a Python version {} past its end of life. Google will update
47-
google-auth with critical bug fixes on a best-effort basis, but not
48-
with any other fixes or features. Please upgrade your Python version,
49-
and then update google-auth.
50-
"""
45+
eol_message = (
46+
"You are using a Python version {} past its end of life. Google will update "
47+
"google-auth with critical bug fixes on a best-effort basis, but not "
48+
"with any other fixes or features. Please upgrade your Python version, "
49+
"and then update google-auth."
50+
)
5151
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
5252
warnings.warn(eol_message.format("3.8"), FutureWarning)
5353
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER

google/oauth2/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
2828

2929

3030
# Raise warnings for deprecated versions
31-
eol_message = """
32-
You are using a Python version {} past its end of life. Google will update
33-
google-auth with critical bug fixes on a best-effort basis, but not
34-
with any other fixes or features. Please upgrade your Python version,
35-
and then update google-auth.
36-
"""
31+
eol_message = (
32+
"You are using a Python version {} past its end of life. Google will update "
33+
"google-auth with critical bug fixes on a best-effort basis, but not "
34+
"with any other fixes or features. Please upgrade your Python version, "
35+
"and then update google-auth."
36+
)
3737
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
3838
warnings.warn(eol_message.format("3.8"), FutureWarning)
3939
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER

noxfile.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,7 @@
5151
"lint",
5252
"blacken",
5353
"mypy",
54-
"unit-3.9",
55-
"unit-3.10",
56-
"unit-3.11",
57-
"unit-3.12",
58-
"unit-3.13",
59-
"unit-3.14",
6054
# cover must be last to avoid error `No data to report`
61-
"cover",
6255
"docs",
6356
]
6457

samples/cloud-client/snippets/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
google-cloud-compute==1.41.0
1+
google-cloud-compute==1.42.0
22
google-cloud-storage==3.8.0
33
google-auth==2.47.0
44
pytest===8.4.2; python_version == '3.9'

system_tests/system_tests_async/test_default.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from google.auth import _default_async
1919
from google.auth.exceptions import RefreshError
20+
import google.oauth2.credentials
2021

2122
EXPECT_PROJECT_ID = os.getenv("EXPECT_PROJECT_ID")
2223
CREDENTIALS = os.getenv("GOOGLE_APPLICATION_CREDENTIALS", "")
@@ -34,12 +35,16 @@ async def test_application_default_credentials(verify_refresh):
3435
except RefreshError as e:
3536
# allow expired credentials for explicit_authorized_user tests
3637
# TODO: https://github.com/googleapis/google-auth-library-python/issues/1882
37-
if not CREDENTIALS.endswith("authorized_user.json"):
38+
is_user_credentials = isinstance(
39+
credentials, google.oauth2.credentials.Credentials
40+
)
41+
if not is_user_credentials and not CREDENTIALS.endswith("authorized_user.json"):
3842
raise
3943

4044
error_message = str(e)
4145
if (
4246
"Token has been expired or revoked" not in error_message
4347
and "invalid_grant" not in error_message
48+
and "invalid_client" not in error_message
4449
):
4550
raise

system_tests/system_tests_sync/test_default.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import google.auth
1818
from google.auth.exceptions import RefreshError
19+
import google.oauth2.credentials
1920

2021
EXPECT_PROJECT_ID = os.getenv("EXPECT_PROJECT_ID")
2122
CREDENTIALS = os.getenv("GOOGLE_APPLICATION_CREDENTIALS", "")
@@ -32,12 +33,16 @@ def test_application_default_credentials(verify_refresh):
3233
except RefreshError as e:
3334
# allow expired credentials for explicit_authorized_user tests
3435
# TODO: https://github.com/googleapis/google-auth-library-python/issues/1882
35-
if not CREDENTIALS.endswith("authorized_user.json"):
36+
is_user_credentials = isinstance(
37+
credentials, google.oauth2.credentials.Credentials
38+
)
39+
if not is_user_credentials and not CREDENTIALS.endswith("authorized_user.json"):
3640
raise
3741

3842
error_message = str(e)
3943
if (
4044
"Token has been expired or revoked" not in error_message
4145
and "invalid_grant" not in error_message
46+
and "invalid_client" not in error_message
4247
):
4348
raise

0 commit comments

Comments
 (0)