|
17 | 17 | Implements application default credentials and project ID detection. |
18 | 18 | """ |
19 | 19 |
|
20 | | -from collections.abc import Sequence |
| 20 | +from __future__ import annotations |
| 21 | + |
21 | 22 | import io |
22 | 23 | import json |
23 | 24 | import logging |
24 | 25 | import os |
25 | | -from typing import Optional, TYPE_CHECKING |
26 | 26 | import warnings |
| 27 | +from typing import TYPE_CHECKING |
27 | 28 |
|
28 | | -from google.auth import environment_vars |
29 | | -from google.auth import exceptions |
30 | 29 | import google.auth.transport._http_client |
| 30 | +from google.auth import environment_vars, exceptions |
| 31 | + |
| 32 | +if TYPE_CHECKING: # pragma: NO COVER |
| 33 | + from typing import Optional, Sequence |
31 | 34 |
|
32 | | -if TYPE_CHECKING: # pragma: NO COVER |
33 | 35 | from google.auth.credentials import Credentials # noqa: F401 |
34 | 36 | from google.auth.transport import Request # noqa: F401 |
35 | 37 |
|
@@ -696,8 +698,10 @@ def default( |
696 | 698 | If no credentials were found, or if the credentials found were |
697 | 699 | invalid. |
698 | 700 | """ |
699 | | - from google.auth.credentials import with_scopes_if_required |
700 | | - from google.auth.credentials import CredentialsWithQuotaProject |
| 701 | + from google.auth.credentials import ( |
| 702 | + CredentialsWithQuotaProject, |
| 703 | + with_scopes_if_required, |
| 704 | + ) |
701 | 705 |
|
702 | 706 | explicit_project_id = os.environ.get( |
703 | 707 | environment_vars.PROJECT, os.environ.get(environment_vars.LEGACY_PROJECT) |
|
0 commit comments