Skip to content

Commit a9b4ea9

Browse files
committed
fix import reordering
1 parent 3858e54 commit a9b4ea9

66 files changed

Lines changed: 442 additions & 313 deletions

File tree

Some content is hidden

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

.generator/ruff.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
# .generator/ruff.toml
2-
3-
# Match Black's line length
42
line-length = 88
53

64
[lint]
7-
# Enable Import sorting (isort)
85
select = ["I"]
96

107
[lint.isort]
11-
# Force 'google' to be recognized as a first-party import
8+
# 1. Force 'google' to be first-party (keeps google.* imports together)
129
known-first-party = ["google"]
1310

11+
# 2. Combine imports from the same module (Standard isort behavior)
12+
# Prevents splitting "from x import a, b" into multiple lines.
13+
combine-as-imports = true
14+
15+
# 3. Sort imports by module name, ignoring "from" vs "import" (Standard isort behavior)
16+
# This minimizes diffs where isort mixed them but Ruff separated them.
17+
force-sort-within-sections = true
18+
1419
[format]
15-
# Strictly enforce double quotes (Black style)
1620
quote-style = "double"

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/async_client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from collections import OrderedDict
1617
import logging as std_logging
1718
import re
18-
from collections import OrderedDict
1919
from typing import (
2020
Callable,
2121
Dict,
@@ -29,14 +29,16 @@
2929
Union,
3030
)
3131

32-
import google.protobuf
33-
from google.api_core import exceptions as core_exceptions
34-
from google.api_core import gapic_v1
35-
from google.api_core import retry_async as retries
32+
from google.api_core import (
33+
exceptions as core_exceptions,
34+
gapic_v1,
35+
retry_async as retries,
36+
)
3637
from google.api_core.client_options import ClientOptions
3738
from google.auth import credentials as ga_credentials # type: ignore
3839
from google.cloud.vision_v1 import gapic_version as package_version
3940
from google.oauth2 import service_account # type: ignore
41+
import google.protobuf
4042

4143
try:
4244
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/client.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
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
1618
import json
1719
import logging as std_logging
1820
import os
1921
import re
20-
import warnings
21-
from collections import OrderedDict
22-
from http import HTTPStatus
2322
from typing import (
2423
Callable,
2524
Dict,
@@ -33,18 +32,21 @@
3332
Union,
3433
cast,
3534
)
35+
import warnings
3636

37-
import google.protobuf
38-
from google.api_core import client_options as client_options_lib
39-
from google.api_core import exceptions as core_exceptions
40-
from google.api_core import gapic_v1
41-
from google.api_core import retry as retries
37+
from google.api_core import (
38+
client_options as client_options_lib,
39+
exceptions as core_exceptions,
40+
gapic_v1,
41+
retry as retries,
42+
)
4243
from google.auth import credentials as ga_credentials # type: ignore
4344
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4445
from google.auth.transport import mtls # type: ignore
4546
from google.auth.transport.grpc import SslCredentials # type: ignore
4647
from google.cloud.vision_v1 import gapic_version as package_version
4748
from google.oauth2 import service_account # type: ignore
49+
import google.protobuf
4850

4951
try:
5052
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/base.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
1818

1919
import google.api_core
20+
from google.api_core import (
21+
exceptions as core_exceptions,
22+
gapic_v1,
23+
operations_v1,
24+
retry as retries,
25+
)
2026
import google.auth # type: ignore
21-
import google.protobuf
22-
from google.api_core import exceptions as core_exceptions
23-
from google.api_core import gapic_v1, operations_v1
24-
from google.api_core import retry as retries
2527
from google.auth import credentials as ga_credentials # type: ignore
2628
from google.cloud.vision_v1 import gapic_version as package_version
2729
from google.cloud.vision_v1.types import image_annotator
2830
from google.longrunning import operations_pb2 # type: ignore
2931
from google.oauth2 import service_account # type: ignore
32+
import google.protobuf
3033

3134
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3235
gapic_version=package_version.__version__

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
import json
1717
import logging as std_logging
1818
import pickle
19-
import warnings
2019
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
20+
import warnings
2121

2222
import grpc # type: ignore
2323
import proto # type: ignore
2424

25-
import google.auth # type: ignore
26-
import google.protobuf.message
2725
from google.api_core import gapic_v1, grpc_helpers, operations_v1
26+
import google.auth # type: ignore
2827
from google.auth import credentials as ga_credentials # type: ignore
2928
from google.auth.transport.grpc import SslCredentials # type: ignore
3029
from google.cloud.vision_v1.types import image_annotator
3130
from google.longrunning import operations_pb2 # type: ignore
3231
from google.protobuf.json_format import MessageToJson
32+
import google.protobuf.message
3333

3434
from .base import DEFAULT_CLIENT_INFO, ImageAnnotatorTransport
3535

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/grpc_asyncio.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,26 @@
1717
import json
1818
import logging as std_logging
1919
import pickle
20-
import warnings
2120
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
21+
import warnings
2222

2323
import grpc # type: ignore
24-
import proto # type: ignore
2524
from grpc.experimental import aio # type: ignore
25+
import proto # type: ignore
2626

27-
import google.protobuf.message
28-
from google.api_core import exceptions as core_exceptions
29-
from google.api_core import gapic_v1, grpc_helpers_async, operations_v1
30-
from google.api_core import retry_async as retries
27+
from google.api_core import (
28+
exceptions as core_exceptions,
29+
gapic_v1,
30+
grpc_helpers_async,
31+
operations_v1,
32+
retry_async as retries,
33+
)
3134
from google.auth import credentials as ga_credentials # type: ignore
3235
from google.auth.transport.grpc import SslCredentials # type: ignore
3336
from google.cloud.vision_v1.types import image_annotator
3437
from google.longrunning import operations_pb2 # type: ignore
3538
from google.protobuf.json_format import MessageToJson
39+
import google.protobuf.message
3640

3741
from .base import DEFAULT_CLIENT_INFO, ImageAnnotatorTransport
3842
from .grpc import ImageAnnotatorGrpcTransport

packages/google-cloud-vision/google/cloud/vision_v1/services/image_annotator/transports/rest.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@
1616
import dataclasses
1717
import json # type: ignore
1818
import logging
19-
import warnings
2019
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
20+
import warnings
2121

2222
from requests import __version__ as requests_version
2323

24-
import google.protobuf
25-
from google.api_core import exceptions as core_exceptions
26-
from google.api_core import gapic_v1, operations_v1, rest_helpers, rest_streaming
27-
from google.api_core import retry as retries
24+
from google.api_core import (
25+
exceptions as core_exceptions,
26+
gapic_v1,
27+
operations_v1,
28+
rest_helpers,
29+
rest_streaming,
30+
retry as retries,
31+
)
2832
from google.auth import credentials as ga_credentials # type: ignore
2933
from google.auth.transport.requests import AuthorizedSession # type: ignore
3034
from google.cloud.vision_v1.types import image_annotator
3135
from google.longrunning import operations_pb2 # type: ignore
36+
import google.protobuf
3237
from google.protobuf import json_format
3338

3439
from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO

packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/async_client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from collections import OrderedDict
1617
import logging as std_logging
1718
import re
18-
from collections import OrderedDict
1919
from typing import (
2020
Callable,
2121
Dict,
@@ -29,14 +29,16 @@
2929
Union,
3030
)
3131

32-
import google.protobuf
33-
from google.api_core import exceptions as core_exceptions
34-
from google.api_core import gapic_v1
35-
from google.api_core import retry_async as retries
32+
from google.api_core import (
33+
exceptions as core_exceptions,
34+
gapic_v1,
35+
retry_async as retries,
36+
)
3637
from google.api_core.client_options import ClientOptions
3738
from google.auth import credentials as ga_credentials # type: ignore
3839
from google.cloud.vision_v1 import gapic_version as package_version
3940
from google.oauth2 import service_account # type: ignore
41+
import google.protobuf
4042

4143
try:
4244
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]

packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/client.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
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
1618
import json
1719
import logging as std_logging
1820
import os
1921
import re
20-
import warnings
21-
from collections import OrderedDict
22-
from http import HTTPStatus
2322
from typing import (
2423
Callable,
2524
Dict,
@@ -33,18 +32,21 @@
3332
Union,
3433
cast,
3534
)
35+
import warnings
3636

37-
import google.protobuf
38-
from google.api_core import client_options as client_options_lib
39-
from google.api_core import exceptions as core_exceptions
40-
from google.api_core import gapic_v1
41-
from google.api_core import retry as retries
37+
from google.api_core import (
38+
client_options as client_options_lib,
39+
exceptions as core_exceptions,
40+
gapic_v1,
41+
retry as retries,
42+
)
4243
from google.auth import credentials as ga_credentials # type: ignore
4344
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4445
from google.auth.transport import mtls # type: ignore
4546
from google.auth.transport.grpc import SslCredentials # type: ignore
4647
from google.cloud.vision_v1 import gapic_version as package_version
4748
from google.oauth2 import service_account # type: ignore
49+
import google.protobuf
4850

4951
try:
5052
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]

packages/google-cloud-vision/google/cloud/vision_v1/services/product_search/pagers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
Union,
2626
)
2727

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
28+
from google.api_core import gapic_v1, retry as retries, retry_async as retries_async
3129

3230
try:
3331
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]

0 commit comments

Comments
 (0)