Skip to content

Commit f1c5cc9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent faa2739 commit f1c5cc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+651
-1050
lines changed

stubs/google/auth/__init__.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
from google.auth._default import default as default, load_credentials_from_dict as load_credentials_from_dict, load_credentials_from_file as load_credentials_from_file
1+
from google.auth._default import (
2+
default as default,
3+
load_credentials_from_dict as load_credentials_from_dict,
4+
load_credentials_from_file as load_credentials_from_file,
5+
)
26

3-
__all__ = ['default', 'load_credentials_from_file', 'load_credentials_from_dict']
7+
__all__ = ["default", "load_credentials_from_file", "load_credentials_from_dict"]
48

59
class Python37DeprecationWarning(DeprecationWarning): ...
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from typing import Any, Optional
1+
from typing import Any
22

33
CRYPTOGRAPHY_NOT_FOUND_ERROR: str
44

5-
def get_agent_identity_certificate_path() -> Optional[str]: ...
6-
def get_and_parse_agent_identity_certificate() -> Optional[Any]: ...
5+
def get_agent_identity_certificate_path() -> str | None: ...
6+
def get_and_parse_agent_identity_certificate() -> Any | None: ...
77
def parse_certificate(cert_bytes: bytes) -> Any: ...
88
def calculate_certificate_fingerprint(cert: Any) -> str: ...
99
def should_request_bound_token(cert: Any) -> bool: ...
10-
def get_cached_cert_fingerprint(cached_cert: Optional[bytes]) -> str: ...
10+
def get_cached_cert_fingerprint(cached_cert: bytes | None) -> str: ...

stubs/google/auth/_cloud_sdk.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
from typing import Optional
2-
31
CLOUD_SDK_CLIENT_ID: str
42

53
def get_config_path() -> str: ...
64
def get_application_default_credentials_path() -> str: ...
7-
def get_project_id() -> Optional[str]: ...
8-
def get_auth_access_token(account: Optional[str] = None) -> str: ...
5+
def get_project_id() -> str | None: ...
6+
def get_auth_access_token(account: str | None = None) -> str: ...

stubs/google/auth/_credentials_async.pyi

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@ from google.auth import credentials
55
from google.auth.transport import Request as _Request
66

77
class Credentials(credentials.Credentials, metaclass=abc.ABCMeta):
8-
async def before_request(
9-
self, request: _Request, method: str, url: str, headers: Mapping[str, str]
10-
) -> None: ...
8+
async def before_request(self, request: _Request, method: str, url: str, headers: Mapping[str, str]) -> None: ...
119

12-
class CredentialsWithQuotaProject(
13-
credentials.CredentialsWithQuotaProject, metaclass=abc.ABCMeta
14-
): ...
10+
class CredentialsWithQuotaProject(credentials.CredentialsWithQuotaProject, metaclass=abc.ABCMeta): ...
1511
class AnonymousCredentials(credentials.AnonymousCredentials, Credentials): ...
1612
class ReadOnlyScoped(credentials.ReadOnlyScoped, metaclass=abc.ABCMeta): ...
1713
class Scoped(credentials.Scoped, metaclass=abc.ABCMeta): ...
1814

19-
def with_scopes_if_required(
20-
credentials: "Credentials", scopes: Sequence[str]
21-
) -> "Credentials": ...
15+
def with_scopes_if_required(credentials: Credentials, scopes: Sequence[str]) -> Credentials: ...

stubs/google/auth/_credentials_base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import abc
2-
32
from _typeshed import Incomplete
3+
44
from google.auth.transport import Request as _TransportRequest
55

66
class _BaseCredentials(metaclass=abc.ABCMeta):

stubs/google/auth/_default.pyi

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Any, Mapping, Optional, Sequence, Tuple
1+
from typing import TYPE_CHECKING, Any, Mapping, Sequence
22

33
from google.auth.credentials import Credentials as Credentials
44
from google.auth.transport import Request as Request
@@ -8,22 +8,22 @@ if TYPE_CHECKING:
88

99
def load_credentials_from_file(
1010
filename: str,
11-
scopes: Optional[Sequence[str]] = None,
12-
default_scopes: Optional[Sequence[str]] = None,
13-
quota_project_id: Optional[str] = None,
14-
request: Optional[Request] = None,
15-
) -> Tuple[Credentials, Optional[str]]: ...
11+
scopes: Sequence[str] | None = None,
12+
default_scopes: Sequence[str] | None = None,
13+
quota_project_id: str | None = None,
14+
request: Request | None = None,
15+
) -> tuple[Credentials, str | None]: ...
1616
def load_credentials_from_dict(
1717
info: Mapping[str, Any],
18-
scopes: Optional[Sequence[str]] = None,
19-
default_scopes: Optional[Sequence[str]] = None,
20-
quota_project_id: Optional[str] = None,
21-
request: Optional[Request] = None,
22-
) -> Tuple[Credentials, Optional[str]]: ...
23-
def get_api_key_credentials(key: str) -> "_ApiKeyCredentials": ...
18+
scopes: Sequence[str] | None = None,
19+
default_scopes: Sequence[str] | None = None,
20+
quota_project_id: str | None = None,
21+
request: Request | None = None,
22+
) -> tuple[Credentials, str | None]: ...
23+
def get_api_key_credentials(key: str) -> _ApiKeyCredentials: ...
2424
def default(
25-
scopes: Optional[Sequence[str]] = None,
26-
request: Optional[Request] = None,
27-
quota_project_id: Optional[str] = None,
28-
default_scopes: Optional[Sequence[str]] = None,
29-
) -> Tuple[Credentials, Optional[str]]: ...
25+
scopes: Sequence[str] | None = None,
26+
request: Request | None = None,
27+
quota_project_id: str | None = None,
28+
default_scopes: Sequence[str] | None = None,
29+
) -> tuple[Credentials, str | None]: ...
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
from typing import Optional, Sequence, Tuple
1+
from typing import Sequence
22

33
from google.auth.credentials import Credentials as Credentials
44
from google.auth.transport import Request as _Request
55

66
def load_credentials_from_file(
7-
filename: str,
8-
scopes: Optional[Sequence[str]] = None,
9-
quota_project_id: Optional[str] = None,
10-
) -> Tuple[Credentials, Optional[str]]: ...
7+
filename: str, scopes: Sequence[str] | None = None, quota_project_id: str | None = None
8+
) -> tuple[Credentials, str | None]: ...
119
def default_async(
12-
scopes: Optional[Sequence[str]] = None,
13-
request: Optional[_Request] = None,
14-
quota_project_id: Optional[str] = None,
15-
) -> Tuple[Credentials, Optional[str]]: ...
10+
scopes: Sequence[str] | None = None, request: _Request | None = None, quota_project_id: str | None = None
11+
) -> tuple[Credentials, str | None]: ...

stubs/google/auth/_exponential_backoff.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ class _BaseExponentialBackoff:
1313

1414
class ExponentialBackoff(_BaseExponentialBackoff):
1515
def __init__(self, *args: object, **kwargs: object) -> None: ...
16-
def __iter__(self) -> "ExponentialBackoff": ...
16+
def __iter__(self) -> ExponentialBackoff: ...
1717
def __next__(self) -> int: ...
1818

1919
class AsyncExponentialBackoff(_BaseExponentialBackoff):
2020
def __init__(self, *args: object, **kwargs: object) -> None: ...
21-
def __aiter__(self) -> "AsyncExponentialBackoff": ...
21+
def __aiter__(self) -> AsyncExponentialBackoff: ...
2222
async def __anext__(self) -> int: ...

stubs/google/auth/_helpers.pyi

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
import logging
3-
from typing import Any, Callable, Mapping, Optional, Sequence, Union
3+
from typing import Any, Callable, Mapping, Sequence
44

55
REFRESH_THRESHOLD: datetime.timedelta
66

@@ -9,23 +9,15 @@ def parse_content_type(header_value: str) -> str: ...
99
def utcnow() -> datetime.datetime: ...
1010
def utcfromtimestamp(timestamp: float) -> datetime.datetime: ...
1111
def datetime_to_secs(value: datetime.datetime) -> int: ...
12-
def to_bytes(value: Union[str, bytes], encoding: str = "utf-8") -> bytes: ...
13-
def from_bytes(value: Union[str, bytes]) -> str: ...
14-
def update_query(
15-
url: str, params: Mapping[str, str], remove: Optional[Sequence[str]] = None
16-
) -> str: ...
12+
def to_bytes(value: str | bytes, encoding: str = "utf-8") -> bytes: ...
13+
def from_bytes(value: str | bytes) -> str: ...
14+
def update_query(url: str, params: Mapping[str, str], remove: Sequence[str] | None = None) -> str: ...
1715
def scopes_to_string(scopes: Sequence[str]) -> str: ...
18-
def string_to_scopes(scopes: Union[Sequence[str], str]) -> list[str]: ...
19-
def padded_urlsafe_b64decode(value: Union[str, bytes]) -> bytes: ...
20-
def unpadded_urlsafe_b64encode(value: Union[str, bytes]) -> Union[str, bytes]: ...
16+
def string_to_scopes(scopes: Sequence[str] | str) -> list[str]: ...
17+
def padded_urlsafe_b64decode(value: str | bytes) -> bytes: ...
18+
def unpadded_urlsafe_b64encode(value: str | bytes) -> str | bytes: ...
2119
def get_bool_from_env(variable_name: str, default: bool = False) -> bool: ...
2220
def is_python_3() -> bool: ...
2321
def is_logging_enabled(logger: logging.Logger) -> bool: ...
24-
def request_log(
25-
logger: logging.Logger,
26-
method: str,
27-
url: str,
28-
body: Optional[bytes],
29-
headers: Mapping[str, str] | None,
30-
) -> None: ...
22+
def request_log(logger: logging.Logger, method: str, url: str, body: bytes | None, headers: Mapping[str, str] | None) -> None: ...
3123
def response_log(logger: logging.Logger, response: Any) -> None: ...

stubs/google/auth/_jwt_async.pyi

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
from typing import Mapping, Optional, Sequence, Union
1+
from typing import Mapping, Sequence
22

33
from google.auth import _credentials_async, jwt
44
from google.auth.crypt import Signer as _Signer
55

66
def encode(
7-
signer: _Signer,
8-
payload: Mapping[str, str],
9-
header: Optional[Mapping[str, str]] = None,
10-
key_id: Optional[str] = None,
7+
signer: _Signer, payload: Mapping[str, str], header: Mapping[str, str] | None = None, key_id: str | None = None
118
) -> bytes: ...
129
def decode(
1310
token: str,
14-
certs: Optional[Union[str, bytes, Mapping[str, Union[str, bytes]]]] = None,
11+
certs: str | bytes | Mapping[str, str | bytes] | None = None,
1512
verify: bool = True,
16-
audience: Optional[Union[str, Sequence[str]]] = None,
13+
audience: str | Sequence[str] | None = None,
1714
) -> Mapping[str, object]: ...
1815

19-
class Credentials(
20-
jwt.Credentials, _credentials_async.Signing, _credentials_async.Credentials
21-
): ...
22-
class OnDemandCredentials(
23-
jwt.OnDemandCredentials, _credentials_async.Signing, _credentials_async.Credentials
24-
): ...
16+
class Credentials(jwt.Credentials, _credentials_async.Signing, _credentials_async.Credentials): ...
17+
class OnDemandCredentials(jwt.OnDemandCredentials, _credentials_async.Signing, _credentials_async.Credentials): ...

0 commit comments

Comments
 (0)