Skip to content

Commit 37b27f2

Browse files
authored
Merge pull request #57 from cloudblue/LITE-25848-add-isort
LITE-25848 Add isort
2 parents 59c2a1e + e3043eb commit 37b27f2

File tree

22 files changed

+581
-538
lines changed

22 files changed

+581
-538
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ $ pip install connect-openapi-client
2727
```
2828

2929

30+
## Development
31+
We use `isort` library to order and format our imports, and we check it using `flake8-isort` library (automatically on `flake8` run).
32+
For convenience you may run `poetry run isort .` to order imports.
33+
34+
3035
## Documentation
3136

3237
[`Connect Python OpenAPI Client` documentation](https://connect-openapi-client.readthedocs.io/en/latest/) is hosted on the _Read the Docs_ service.

connect/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#
66
from connect.client.exceptions import ClientError # noqa
77
from connect.client.fluent import AsyncConnectClient, ConnectClient # noqa
8+
from connect.client.logger import RequestLogger # noqa
89
from connect.client.rql import R # noqa
9-
from connect.client.logger import RequestLogger # noqa

connect/client/contrib/locust/user.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import time
22

33
from locust import HttpUser
4-
54
from requests import RequestException
65

76
from connect.client import ConnectClient

connect/client/fluent.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
from json.decoder import JSONDecodeError
99

1010
import httpx
11-
1211
import requests
1312

1413
from connect.client.constants import CONNECT_ENDPOINT_URL, CONNECT_SPECS_URL
15-
from connect.client.mixins import AsyncClientMixin, SyncClientMixin
16-
from connect.client.models import AsyncCollection, AsyncNS, Collection, NS
17-
from connect.client.utils import get_headers
1814
from connect.client.help_formatter import DefaultFormatter
15+
from connect.client.mixins import AsyncClientMixin, SyncClientMixin
16+
from connect.client.models import (
17+
NS,
18+
AsyncCollection,
19+
AsyncNS,
20+
Collection,
21+
)
1922
from connect.client.openapi import OpenAPISpecs
23+
from connect.client.utils import get_headers
2024

2125

2226
class _ConnectClientBase(threading.local):

connect/client/help_formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
# Copyright (c) 2021 Ingram Micro. All Rights Reserved.
55
#
66
import inflect
7+
from connect.utils.terminal.markdown import render
78

89
from connect.client.models import (
10+
NS,
911
Action,
1012
AsyncAction,
1113
AsyncCollection,
1214
AsyncNS,
1315
AsyncResource,
1416
AsyncResourceSet,
1517
Collection,
16-
NS,
1718
Resource,
1819
ResourceSet,
1920
)
20-
from connect.utils.terminal.markdown import render
2121

2222

2323
_COL_HTTP_METHOD_TO_METHOD = {

connect/client/mixins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import time
77

88
from httpx import HTTPError
9-
109
from requests.exceptions import RequestException, Timeout
1110

1211
from connect.client.exceptions import ClientError

connect/client/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
# Copyright (c) 2021 Ingram Micro. All Rights Reserved.
55
#
66
from connect.client.models.base import ( # noqa
7+
NS,
78
Action,
89
AsyncAction,
910
AsyncCollection,
1011
AsyncNS,
1112
AsyncResource,
1213
Collection,
13-
NS,
1414
Resource,
1515
)
1616
from connect.client.models.exceptions import NotYetEvaluatedError # noqa
17-
from connect.client.models.resourceset import AsyncResourceSet, ResourceSet # noqa
17+
from connect.client.models.resourceset import AsyncResourceSet, ResourceSet # noqa

connect/client/models/resourceset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
ValuesListIterator,
1414
aiter,
1515
)
16-
from connect.client.utils import parse_content_range, resolve_attribute
1716
from connect.client.rql import R
17+
from connect.client.utils import parse_content_range, resolve_attribute
1818

1919

2020
class _ResourceSetBase:

connect/client/openapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
#
44
# Copyright (c) 2021 Ingram Micro. All Rights Reserved.
55
#
6-
from io import StringIO
76
from functools import partial
7+
from io import StringIO
88

99
import requests
10-
1110
import yaml
1211

1312

connect/client/testing/fluent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
import json
77

88
import httpx
9-
109
import responses
11-
from responses import matchers
12-
1310
from pytest import MonkeyPatch
14-
1511
from pytest_httpx import HTTPXMock
1612
from pytest_httpx._httpx_mock import _PytestAsyncTransport
13+
from responses import matchers
1714

1815
from connect.client.fluent import _ConnectClientBase
1916
from connect.client.testing.models import CollectionMock, NSMock

0 commit comments

Comments
 (0)