Skip to content

Commit 7dd5a03

Browse files
committed
chore: reformat with ruff
1 parent 2a28448 commit 7dd5a03

File tree

105 files changed

+877
-830
lines changed

Some content is hidden

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

105 files changed

+877
-830
lines changed

packages/google-cloud-storage/google/cloud/_storage_v2/__init__.py

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from google.cloud._storage_v2 import gapic_version as package_version
16+
import sys
1717

1818
import google.api_core as api_core
19-
import sys
19+
20+
from google.cloud._storage_v2 import gapic_version as package_version
2021

2122
__version__ = package_version.__version__
2223

@@ -28,65 +29,65 @@
2829
import importlib_metadata as metadata
2930

3031

31-
from .services.storage import StorageClient
32-
from .services.storage import StorageAsyncClient
33-
34-
from .types.storage import AppendObjectSpec
35-
from .types.storage import BidiReadHandle
36-
from .types.storage import BidiReadObjectError
37-
from .types.storage import BidiReadObjectRedirectedError
38-
from .types.storage import BidiReadObjectRequest
39-
from .types.storage import BidiReadObjectResponse
40-
from .types.storage import BidiReadObjectSpec
41-
from .types.storage import BidiWriteHandle
42-
from .types.storage import BidiWriteObjectRedirectedError
43-
from .types.storage import BidiWriteObjectRequest
44-
from .types.storage import BidiWriteObjectResponse
45-
from .types.storage import Bucket
46-
from .types.storage import BucketAccessControl
47-
from .types.storage import CancelResumableWriteRequest
48-
from .types.storage import CancelResumableWriteResponse
49-
from .types.storage import ChecksummedData
50-
from .types.storage import CommonObjectRequestParams
51-
from .types.storage import ComposeObjectRequest
52-
from .types.storage import ContentRange
53-
from .types.storage import CreateBucketRequest
54-
from .types.storage import CustomerEncryption
55-
from .types.storage import DeleteBucketRequest
56-
from .types.storage import DeleteObjectRequest
57-
from .types.storage import GetBucketRequest
58-
from .types.storage import GetObjectRequest
59-
from .types.storage import ListBucketsRequest
60-
from .types.storage import ListBucketsResponse
61-
from .types.storage import ListObjectsRequest
62-
from .types.storage import ListObjectsResponse
63-
from .types.storage import LockBucketRetentionPolicyRequest
64-
from .types.storage import MoveObjectRequest
65-
from .types.storage import Object
66-
from .types.storage import ObjectAccessControl
67-
from .types.storage import ObjectChecksums
68-
from .types.storage import ObjectContexts
69-
from .types.storage import ObjectCustomContextPayload
70-
from .types.storage import ObjectRangeData
71-
from .types.storage import Owner
72-
from .types.storage import ProjectTeam
73-
from .types.storage import QueryWriteStatusRequest
74-
from .types.storage import QueryWriteStatusResponse
75-
from .types.storage import ReadObjectRequest
76-
from .types.storage import ReadObjectResponse
77-
from .types.storage import ReadRange
78-
from .types.storage import ReadRangeError
79-
from .types.storage import RestoreObjectRequest
80-
from .types.storage import RewriteObjectRequest
81-
from .types.storage import RewriteResponse
82-
from .types.storage import ServiceConstants
83-
from .types.storage import StartResumableWriteRequest
84-
from .types.storage import StartResumableWriteResponse
85-
from .types.storage import UpdateBucketRequest
86-
from .types.storage import UpdateObjectRequest
87-
from .types.storage import WriteObjectRequest
88-
from .types.storage import WriteObjectResponse
89-
from .types.storage import WriteObjectSpec
32+
from .services.storage import StorageAsyncClient, StorageClient
33+
from .types.storage import (
34+
AppendObjectSpec,
35+
BidiReadHandle,
36+
BidiReadObjectError,
37+
BidiReadObjectRedirectedError,
38+
BidiReadObjectRequest,
39+
BidiReadObjectResponse,
40+
BidiReadObjectSpec,
41+
BidiWriteHandle,
42+
BidiWriteObjectRedirectedError,
43+
BidiWriteObjectRequest,
44+
BidiWriteObjectResponse,
45+
Bucket,
46+
BucketAccessControl,
47+
CancelResumableWriteRequest,
48+
CancelResumableWriteResponse,
49+
ChecksummedData,
50+
CommonObjectRequestParams,
51+
ComposeObjectRequest,
52+
ContentRange,
53+
CreateBucketRequest,
54+
CustomerEncryption,
55+
DeleteBucketRequest,
56+
DeleteObjectRequest,
57+
GetBucketRequest,
58+
GetObjectRequest,
59+
ListBucketsRequest,
60+
ListBucketsResponse,
61+
ListObjectsRequest,
62+
ListObjectsResponse,
63+
LockBucketRetentionPolicyRequest,
64+
MoveObjectRequest,
65+
Object,
66+
ObjectAccessControl,
67+
ObjectChecksums,
68+
ObjectContexts,
69+
ObjectCustomContextPayload,
70+
ObjectRangeData,
71+
Owner,
72+
ProjectTeam,
73+
QueryWriteStatusRequest,
74+
QueryWriteStatusResponse,
75+
ReadObjectRequest,
76+
ReadObjectResponse,
77+
ReadRange,
78+
ReadRangeError,
79+
RestoreObjectRequest,
80+
RewriteObjectRequest,
81+
RewriteResponse,
82+
ServiceConstants,
83+
StartResumableWriteRequest,
84+
StartResumableWriteResponse,
85+
UpdateBucketRequest,
86+
UpdateObjectRequest,
87+
WriteObjectRequest,
88+
WriteObjectResponse,
89+
WriteObjectSpec,
90+
)
9091

9192
if hasattr(api_core, "check_python_version") and hasattr(
9293
api_core, "check_dependency_versions"
@@ -97,8 +98,8 @@
9798
# An older version of api_core is installed which does not define the
9899
# functions above. We do equivalent checks manually.
99100
try:
100-
import warnings
101101
import sys
102+
import warnings
102103

103104
_py_version_str = sys.version.split()[0]
104105
_package_label = "google.cloud._storage_v2"

packages/google-cloud-storage/google/cloud/_storage_v2/services/storage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from .client import StorageClient
1716
from .async_client import StorageAsyncClient
17+
from .client import StorageClient
1818

1919
__all__ = (
2020
"StorageClient",

packages/google-cloud-storage/google/cloud/_storage_v2/services/storage/async_client.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,51 @@
1414
# limitations under the License.
1515
#
1616
import logging as std_logging
17-
from collections import OrderedDict
1817
import re
18+
from collections import OrderedDict
1919
from typing import (
20-
Dict,
20+
AsyncIterable,
21+
AsyncIterator,
22+
Awaitable,
2123
Callable,
24+
Dict,
2225
Mapping,
2326
MutableMapping,
2427
MutableSequence,
2528
Optional,
26-
AsyncIterable,
27-
Awaitable,
28-
AsyncIterator,
2929
Sequence,
3030
Tuple,
3131
Type,
3232
Union,
3333
)
3434

35-
from google.cloud._storage_v2 import gapic_version as package_version
36-
37-
from google.api_core.client_options import ClientOptions
35+
import google.protobuf
3836
from google.api_core import exceptions as core_exceptions
3937
from google.api_core import gapic_v1
4038
from google.api_core import retry_async as retries
39+
from google.api_core.client_options import ClientOptions
4140
from google.auth import credentials as ga_credentials # type: ignore
4241
from google.oauth2 import service_account # type: ignore
43-
import google.protobuf
4442

43+
from google.cloud._storage_v2 import gapic_version as package_version
4544

4645
try:
4746
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
4847
except AttributeError: # pragma: NO COVER
4948
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
5049

51-
from google.cloud._storage_v2.services.storage import pagers
52-
from google.cloud._storage_v2.types import storage
53-
from google.longrunning import operations_pb2 # type: ignore
5450
import google.iam.v1.iam_policy_pb2 as iam_policy_pb2 # type: ignore
5551
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore
5652
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
5753
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
58-
from .transports.base import StorageTransport, DEFAULT_CLIENT_INFO
59-
from .transports.grpc_asyncio import StorageGrpcAsyncIOTransport
54+
from google.longrunning import operations_pb2 # type: ignore
55+
56+
from google.cloud._storage_v2.services.storage import pagers
57+
from google.cloud._storage_v2.types import storage
58+
6059
from .client import StorageClient
60+
from .transports.base import DEFAULT_CLIENT_INFO, StorageTransport
61+
from .transports.grpc_asyncio import StorageGrpcAsyncIOTransport
6162

6263
try:
6364
from google.api_core import client_logging # type: ignore

packages/google-cloud-storage/google/cloud/_storage_v2/services/storage/client.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,41 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from collections import OrderedDict
17-
from http import HTTPStatus
1816
import json
1917
import logging as std_logging
2018
import os
2119
import re
20+
import warnings
21+
from collections import OrderedDict
22+
from http import HTTPStatus
2223
from typing import (
23-
Dict,
2424
Callable,
25+
Dict,
26+
Iterable,
27+
Iterator,
2528
Mapping,
2629
MutableMapping,
2730
MutableSequence,
2831
Optional,
29-
Iterable,
30-
Iterator,
3132
Sequence,
3233
Tuple,
3334
Type,
3435
Union,
3536
cast,
3637
)
37-
import warnings
38-
39-
from google.cloud._storage_v2 import gapic_version as package_version
4038

39+
import google.protobuf
4140
from google.api_core import client_options as client_options_lib
4241
from google.api_core import exceptions as core_exceptions
4342
from google.api_core import gapic_v1
4443
from google.api_core import retry as retries
4544
from google.auth import credentials as ga_credentials # type: ignore
45+
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4646
from google.auth.transport import mtls # type: ignore
4747
from google.auth.transport.grpc import SslCredentials # type: ignore
48-
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4948
from google.oauth2 import service_account # type: ignore
50-
import google.protobuf
49+
50+
from google.cloud._storage_v2 import gapic_version as package_version
5151

5252
try:
5353
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
@@ -63,14 +63,20 @@
6363

6464
_LOGGER = std_logging.getLogger(__name__)
6565

66+
from google.iam.v1 import (
67+
iam_policy_pb2, # type: ignore
68+
policy_pb2, # type: ignore
69+
)
70+
from google.longrunning import operations_pb2 # type: ignore
71+
from google.protobuf import (
72+
field_mask_pb2, # type: ignore
73+
timestamp_pb2, # type: ignore
74+
)
75+
6676
from google.cloud._storage_v2.services.storage import pagers
6777
from google.cloud._storage_v2.types import storage
68-
from google.iam.v1 import iam_policy_pb2 # type: ignore
69-
from google.iam.v1 import policy_pb2 # type: ignore
70-
from google.longrunning import operations_pb2 # type: ignore
71-
from google.protobuf import field_mask_pb2 # type: ignore
72-
from google.protobuf import timestamp_pb2 # type: ignore
73-
from .transports.base import StorageTransport, DEFAULT_CLIENT_INFO
78+
79+
from .transports.base import DEFAULT_CLIENT_INFO, StorageTransport
7480
from .transports.grpc import StorageGrpcTransport
7581
from .transports.grpc_asyncio import StorageGrpcAsyncIOTransport
7682

@@ -713,8 +719,7 @@ def __init__(
713719
)
714720
if self._client_options.scopes:
715721
raise ValueError(
716-
"When providing a transport instance, provide its scopes "
717-
"directly."
722+
"When providing a transport instance, provide its scopes directly."
718723
)
719724
self._transport = cast(StorageTransport, transport)
720725
self._api_endpoint = self._transport.host

packages/google-cloud-storage/google/cloud/_storage_v2/services/storage/pagers.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from google.api_core import gapic_v1
17-
from google.api_core import retry as retries
18-
from google.api_core import retry_async as retries_async
1916
from typing import (
2017
Any,
2118
AsyncIterator,
2219
Awaitable,
2320
Callable,
21+
Iterator,
22+
Optional,
2423
Sequence,
2524
Tuple,
26-
Optional,
27-
Iterator,
2825
Union,
2926
)
3027

28+
from google.api_core import gapic_v1
29+
from google.api_core import retry as retries
30+
from google.api_core import retry_async as retries_async
31+
3132
try:
3233
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
3334
OptionalAsyncRetry = Union[
@@ -66,7 +67,7 @@ def __init__(
6667
*,
6768
retry: OptionalRetry = gapic_v1.method.DEFAULT,
6869
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
69-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
70+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
7071
):
7172
"""Instantiate the pager.
7273
@@ -142,7 +143,7 @@ def __init__(
142143
*,
143144
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
144145
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
145-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
146+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
146147
):
147148
"""Instantiates the pager.
148149
@@ -222,7 +223,7 @@ def __init__(
222223
*,
223224
retry: OptionalRetry = gapic_v1.method.DEFAULT,
224225
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
225-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
226+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
226227
):
227228
"""Instantiate the pager.
228229
@@ -298,7 +299,7 @@ def __init__(
298299
*,
299300
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
300301
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
301-
metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
302+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
302303
):
303304
"""Instantiates the pager.
304305

packages/google-cloud-storage/google/cloud/_storage_v2/services/storage/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from .grpc import StorageGrpcTransport
2121
from .grpc_asyncio import StorageGrpcAsyncIOTransport
2222

23-
2423
# Compile a registry of transports.
2524
_transport_registry = OrderedDict() # type: Dict[str, Type[StorageTransport]]
2625
_transport_registry["grpc"] = StorageGrpcTransport

0 commit comments

Comments
 (0)