8000 Sort some imports · danielgtaylor/python-betterproto@1010b39 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1010b39

Browse files
committed
Sort some imports
1 parent 25b5322 commit 1010b39

File tree

5 files changed

+25
-29
lines changed

5 files changed

+25
-29
lines changed

src/betterproto/grpc/grpclib_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from abc import ABC
22
from collections.abc import AsyncIterable
3-
from typing import Callable, Any, Dict
3+
from typing import Any, Callable, Dict
44

55
import grpclib
66
import grpclib.server

src/betterproto/plugin/models.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131

3232

3333
import builtins
34+
import re
35+
import textwrap
36+
from dataclasses import dataclass, field
37+
from typing import Dict, Iterable, Iterator, List, Optional, Set, Type, Union
38+
3439
import betterproto
3540
from betterproto import which_one_of
3641
from betterproto.casing import sanitize_name
37-
from betterproto.compile.importing import (
38-
get_type_reference,
39-
parse_source_type_name,
40-
)
42+
from betterproto.compile.importing import get_type_reference, parse_source_type_name
4143
from betterproto.compile.naming import (
4244
pythonize_class_name,
4345
pythonize_field_name,
@@ -46,21 +48,15 @@
4648
from betterproto.lib.google.protobuf import (
4749
DescriptorProto,
4850
EnumDescriptorProto,
49-
FileDescriptorProto,
50-
MethodDescriptorProto,
5151
Field,
5252
FieldDescriptorProto,
53-
FieldDescriptorProtoType,
5453
FieldDescriptorProtoLabel,
54+
FieldDescriptorProtoType,
55+
FileDescriptorProto,
56+
MethodDescriptorProto,
5557
)
5658
from betterproto.lib.google.protobuf.compiler import CodeGeneratorRequest
5759

58-
59-
import re
60-
import textwrap
61-
from dataclasses import dataclass, field
62-
from typing import Dict, Iterable, Iterator, List, Optional, Set, Type, Union
63-
6460
from ..casing import sanitize_name
6561
from ..compile.importing import get_type_reference, parse_source_type_name
6662
from ..compile.naming import (
@@ -69,7 +65,6 @@
6965
pythonize_method_name,
7066
)
7167

72-
7368
# Create a unique placeholder to deal with
7469
# https://stackoverflow.com/questions/51575931/class-inheritance-in-python-3-7-dataclasses
7570
PLACEHOLDER = object()

tests/grpc/test_grpclib_client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import asyncio
22
import sys
33

4-
from tests.output_betterproto.service.service import (
5-
DoThingRequest,
6-
DoThingResponse,
7-
GetThingRequest,
8-
TestStub as ThingServiceClient,
9-
)
104
import grpclib
115
import grpclib.metadata
126
import grpclib.server
13-
from grpclib.testing import ChannelFor< 8000 /span>
147
import pytest
158
from betterproto.grpc.util.async_channel import AsyncChannel
9+
from grpclib.testing import ChannelFor
10+
from tests.output_betterproto.service.service import (
11+
DoThingRequest,
12+
DoThingResponse,
13+
GetThingRequest,
14+
)
15+
from tests.output_betterproto.service.service import TestStub as ThingServiceClient
16+
1617
from .thing_service import ThingService
1718

1819

tests/inputs/example_service/test_example_service.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
from typing import AsyncIterator, AsyncIterable
1+
from typing import AsyncIterable, AsyncIterator
22

33
import pytest
44
from grpclib.testing import ChannelFor
5-
65
from tests.output_betterproto.example_service.example_service import (
7-
TestBase,
8-
TestStub,
96
ExampleRequest,
107
ExampleResponse,
8+
TestBase,
9+
TestStub,
1110
)
1211

1312

tests/test_features.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import betterproto
21
from dataclasses import dataclass
3-
from typing import Optional, List, Dict
42
from datetime import datetime
5-
from inspect import signature
3+
from inspect import Parameter, signature
4+
from typing import Dict, List, Optional
5+
6+
import betterproto
67

78

89
def test_has_field():

0 commit comments

Comments
 (0)
0