Skip to content

Commit ad6cac4

Browse files
authored
chore: update Ruff to 0.8 (#290)
1 parent ed6d3c7 commit ad6cac4

File tree

8 files changed

+211
-210
lines changed

8 files changed

+211
-210
lines changed

poetry.lock

Lines changed: 162 additions & 168 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pytest-only = "~2.1.0"
6161
pytest-timeout = "~2.3.0"
6262
pytest-xdist = "~3.6.0"
6363
redbaron = "~0.9.0"
64-
ruff = "~0.7.0"
64+
ruff = "~0.8.0"
6565
setuptools = "~75.0.0" # setuptools are used by pytest but not explicitly required
6666

6767
[tool.ruff]
@@ -70,8 +70,6 @@ line-length = 150
7070
[tool.ruff.lint]
7171
select = ["ALL"]
7272
ignore = [
73-
"ANN101", # Missing type annotation for `self` in method
74-
"ANN102", # Missing type annotation for `{name}` in classmethod
7573
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {filename}
7674
"ASYNC109", # Async function definition with a `timeout` parameter
7775
"BLE001", # Do not catch blind exception
@@ -167,7 +165,7 @@ exclude = []
167165
exclude_lines = [
168166
"pragma: no cover",
169167
"if TYPE_CHECKING:",
170-
"assert_never()"
168+
"assert_never()",
171169
]
172170

173171
[tool.basedpyright]

src/apify_client/_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
import random
77
import time
88
from http import HTTPStatus
9-
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, List, TypeVar, cast
9+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
1010

1111
from apify_shared.utils import is_file_or_bytes, maybe_extract_enum_member_value
1212

1313
if TYPE_CHECKING:
14+
from collections.abc import Awaitable
15+
1416
from apify_client._errors import ApifyApiError
1517

1618
PARSE_DATE_FIELDS_MAX_DEPTH = 3
@@ -31,14 +33,14 @@ def to_safe_id(id: str) -> str:
3133

3234
def pluck_data(parsed_response: Any) -> dict:
3335
if isinstance(parsed_response, dict) and 'data' in parsed_response:
34-
return cast(Dict, parsed_response['data'])
36+
return cast(dict, parsed_response['data'])
3537

3638
raise ValueError('The "data" property is missing in the response.')
3739

3840

3941
def pluck_data_as_list(parsed_response: Any) -> list:
4042
if isinstance(parsed_response, dict) and 'data' in parsed_response:
41-
return cast(List, parsed_response['data'])
43+
return cast(list, parsed_response['data'])
4244

4345
raise ValueError('The "data" property is missing in the response.')
4446

src/apify_client/clients/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@
6666
)
6767

6868
__all__ = [
69-
'ActorJobBaseClient',
70-
'ActorJobBaseClientAsync',
71-
'BaseClient',
72-
'BaseClientAsync',
73-
'ResourceClient',
74-
'ResourceClientAsync',
75-
'ResourceCollectionClient',
76-
'ResourceCollectionClientAsync',
7769
'ActorClient',
7870
'ActorClientAsync',
7971
'ActorCollectionClient',
@@ -82,10 +74,14 @@
8274
'ActorEnvVarClientAsync',
8375
'ActorEnvVarCollectionClient',
8476
'ActorEnvVarCollectionClientAsync',
77+
'ActorJobBaseClient',
78+
'ActorJobBaseClientAsync',
8579
'ActorVersionClient',
8680
'ActorVersionClientAsync',
8781
'ActorVersionCollectionClient',
8882
'ActorVersionCollectionClientAsync',
83+
'BaseClient',
84+
'BaseClientAsync',
8985
'BuildClient',
9086
'BuildClientAsync',
9187
'BuildCollectionClient',
@@ -104,6 +100,10 @@
104100
'RequestQueueClientAsync',
105101
'RequestQueueCollectionClient',
106102
'RequestQueueCollectionClientAsync',
103+
'ResourceClient',
104+
'ResourceClientAsync',
105+
'ResourceCollectionClient',
106+
'ResourceCollectionClientAsync',
107107
'RunClient',
108108
'RunClientAsync',
109109
'RunCollectionClient',
@@ -112,6 +112,8 @@
112112
'ScheduleClientAsync',
113113
'ScheduleCollectionClient',
114114
'ScheduleCollectionClientAsync',
115+
'StoreCollectionClient',
116+
'StoreCollectionClientAsync',
115117
'TaskClient',
116118
'TaskClientAsync',
117119
'TaskCollectionClient',
@@ -126,6 +128,4 @@
126128
'WebhookDispatchClientAsync',
127129
'WebhookDispatchCollectionClient',
128130
'WebhookDispatchCollectionClientAsync',
129-
'StoreCollectionClient',
130-
'StoreCollectionClientAsync',
131131
]

src/apify_client/clients/resource_clients/__init__.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,46 +39,46 @@
3939
'ActorVersionClientAsync',
4040
'ActorVersionCollectionClient',
4141
'ActorVersionCollectionClientAsync',
42-
'RunClient',
42+
'BuildClient',
4343
'BuildClientAsync',
44-
'RunCollectionClient',
44+
'BuildCollectionClient',
4545
'BuildCollectionClientAsync',
46-
'BuildClient',
46+
'DatasetClient',
4747
'DatasetClientAsync',
48-
'BuildCollectionClient',
48+
'DatasetCollectionClient',
4949
'DatasetCollectionClientAsync',
50-
'DatasetClient',
50+
'KeyValueStoreClient',
5151
'KeyValueStoreClientAsync',
52-
'DatasetCollectionClient',
52+
'KeyValueStoreCollectionClient',
5353
'KeyValueStoreCollectionClientAsync',
54-
'KeyValueStoreClient',
54+
'LogClient',
5555
'LogClientAsync',
56-
'KeyValueStoreCollectionClient',
57-
'RequestQueueClientAsync',
5856
'RequestQueueClient',
59-
'RequestQueueCollectionClientAsync',
57+
'RequestQueueClientAsync',
6058
'RequestQueueCollectionClient',
59+
'RequestQueueCollectionClientAsync',
60+
'RunClient',
6161
'RunClientAsync',
62-
'LogClient',
62+
'RunCollectionClient',
6363
'RunCollectionClientAsync',
64-
'WebhookClient',
64+
'ScheduleClient',
6565
'ScheduleClientAsync',
66-
'WebhookCollectionClient',
66+
'ScheduleCollectionClient',
6767
'ScheduleCollectionClientAsync',
68-
'WebhookDispatchClient',
68+
'StoreCollectionClient',
69+
'StoreCollectionClientAsync',
70+
'TaskClient',
6971
'TaskClientAsync',
70-
'WebhookDispatchCollectionClient',
72+
'TaskCollectionClient',
7173
'TaskCollectionClientAsync',
72-
'TaskClient',
74+
'UserClient',
7375
'UserClientAsync',
74-
'TaskCollectionClient',
76+
'WebhookClient',
7577
'WebhookClientAsync',
76-
'ScheduleClient',
78+
'WebhookCollectionClient',
7779
'WebhookCollectionClientAsync',
78-
'ScheduleCollectionClient',
80+
'WebhookDispatchClient',
7981
'WebhookDispatchClientAsync',
80-
'UserClient',
82+
'WebhookDispatchCollectionClient',
8183
'WebhookDispatchCollectionClientAsync',
82-
'StoreCollectionClient',
83-
'StoreCollectionClientAsync',
8484
]

src/apify_client/clients/resource_clients/dataset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
import warnings
44
from contextlib import asynccontextmanager, contextmanager
5-
from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator
5+
from typing import TYPE_CHECKING, Any
66

77
from apify_shared.models import ListPage
88
from apify_shared.utils import filter_out_none_values_recursively, ignore_docs
99

1010
from apify_client.clients.base import ResourceClient, ResourceClientAsync
1111

1212
if TYPE_CHECKING:
13+
from collections.abc import AsyncIterator, Iterator
14+
1315
import httpx
1416
from apify_shared.types import JSONSerializable
1517

src/apify_client/clients/resource_clients/key_value_store.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
import warnings
44
from contextlib import asynccontextmanager, contextmanager
5-
from typing import Any, AsyncIterator, Iterator
5+
from typing import TYPE_CHECKING, Any
66

77
from apify_shared.utils import filter_out_none_values_recursively, ignore_docs, parse_date_fields
88

99
from apify_client._errors import ApifyApiError
1010
from apify_client._utils import catch_not_found_or_throw, encode_key_value_store_record_value, pluck_data
1111
from apify_client.clients.base import ResourceClient, ResourceClientAsync
1212

13+
if TYPE_CHECKING:
14+
from collections.abc import AsyncIterator, Iterator
15+
1316

1417
class KeyValueStoreClient(ResourceClient):
1518
"""Sub-client for manipulating a single key-value store."""

src/apify_client/clients/resource_clients/log.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from contextlib import asynccontextmanager, contextmanager
4-
from typing import TYPE_CHECKING, Any, AsyncIterator, Iterator
4+
from typing import TYPE_CHECKING, Any
55

66
from apify_shared.utils import ignore_docs
77

@@ -10,6 +10,8 @@
1010
from apify_client.clients.base import ResourceClient, ResourceClientAsync
1111

1212
if TYPE_CHECKING:
13+
from collections.abc import AsyncIterator, Iterator
14+
1315
import httpx
1416

1517

0 commit comments

Comments
 (0)