Skip to content

Commit e0a2a57

Browse files
authored
chore: some linter and imports (#555)
| Q | A | ----------------- | ---------- | Bug fix? | no | New feature? | no | BC breaks? | no | Related Issue | Fix #... <!-- will close issue automatically, if any --> | Need Doc update | no ## Describe your change autofixed format with `black`'s default config, so that the client is a bit more organized before the new major :) also updated the readme for the new install command
1 parent 639cac8 commit e0a2a57

Some content is hidden

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

42 files changed

+110
-148
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
First, install Algolia Python API Client via the [pip](https://pip.pypa.io/en/stable/installing) package manager:
3434

3535
```bash
36-
pip install --upgrade 'algoliasearch>=2.0,<3.0'
36+
pip install --upgrade 'algoliasearch>=3.0,<4.0'
3737
```
3838

3939
Then, create objects on your index:

algoliasearch/account_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, Union, Dict, Any
1+
from typing import Any, Dict, Optional, Union
22

33
from algoliasearch.exceptions import AlgoliaException, RequestException
44
from algoliasearch.http.request_options import RequestOptions

algoliasearch/analytics_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, Union, Dict, Any
1+
from typing import Any, Dict, Optional, Union
22

33
from algoliasearch.configs import AnalyticsConfig
44
from algoliasearch.helpers import endpoint, is_async_available
@@ -34,8 +34,8 @@ def create_with_config(config):
3434

3535
if is_async_available():
3636
from algoliasearch.analytics_client_async import AnalyticsClientAsync
37-
from algoliasearch.http.transporter_async import TransporterAsync
3837
from algoliasearch.http.requester_async import RequesterAsync
38+
from algoliasearch.http.transporter_async import TransporterAsync
3939

4040
return AnalyticsClientAsync(
4141
client, TransporterAsync(RequesterAsync(), config), config

algoliasearch/analytics_client_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import types
2-
32
from typing import Optional, Type
43

54
from algoliasearch.analytics_client import AnalyticsClient

algoliasearch/configs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import abc
22
import os
3-
43
from typing import Dict, Optional
54

65
from algoliasearch.exceptions import AlgoliaException
7-
from algoliasearch.http.hosts import Host, HostsCollection, CallType
6+
from algoliasearch.http.hosts import CallType, Host, HostsCollection
87
from algoliasearch.user_agent import UserAgent
98

109

algoliasearch/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import math
33
import sys
44
import time
5-
6-
from typing import Optional, Iterable, List, Union, Iterator, Dict, Any
5+
from typing import Any, Dict, Iterable, Iterator, List, Optional, Union
76

87
from algoliasearch.exceptions import MissingObjectIdException
98

@@ -61,6 +60,7 @@ def is_async_available():
6160
if sys.version_info >= (3, 0):
6261
try:
6362
import asyncio
63+
6464
import aiohttp
6565
import async_timeout
6666

algoliasearch/helpers_async.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import types
2-
32
from typing import Callable
43

54

algoliasearch/http/hosts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from random import shuffle
2-
32
from typing import List, Optional, cast
43

54

algoliasearch/http/request_options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import copy
2-
3-
from typing import Optional, Any, Dict, Union
2+
from typing import Any, Dict, Optional, Union
43

54
from algoliasearch.configs import Config
65
from algoliasearch.helpers import get_items

algoliasearch/http/requester.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
from typing import Union
22

33
import requests
4-
5-
from requests import Timeout, RequestException, Session
4+
from requests import RequestException, Session, Timeout
65
from requests.adapters import HTTPAdapter
76
from urllib3.util import Retry
87

9-
from algoliasearch.http.transporter import Response, Request
8+
from algoliasearch.http.transporter import Request, Response
109

1110

1211
class Requester(object):

0 commit comments

Comments
 (0)