Skip to content

Commit 9be4336

Browse files
authored
feat: update to Crawlee v0.6 (#420)
1 parent 347bea3 commit 9be4336

12 files changed

+118
-317
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ keywords = [
3535
]
3636
dependencies = [
3737
"apify-client>=1.9.2",
38-
"apify-shared>=1.2.1",
39-
"crawlee~=0.5.0",
38+
"apify-shared>=1.3.0",
39+
"crawlee~=0.6.0",
4040
"cryptography>=42.0.0",
4141
"httpx>=0.27.0",
4242
"lazy-object-proxy>=1.10.0",

src/apify/_actor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from typing_extensions import Self
4444

4545
from crawlee.proxy_configuration import _NewUrlFunction
46-
from crawlee.storage_clients import BaseStorageClient
46+
from crawlee.storage_clients import StorageClient
4747

4848
from apify._models import Webhook
4949

@@ -171,7 +171,7 @@ def log(self) -> logging.Logger:
171171
return logger
172172

173173
@property
174-
def _local_storage_client(self) -> BaseStorageClient:
174+
def _local_storage_client(self) -> StorageClient:
175175
"""The local storage client the Actor instance uses."""
176176
return service_locator.get_storage_client()
177177

src/apify/apify_storage_client/_apify_storage_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from apify_client import ApifyClientAsync
88
from crawlee._utils.crypto import crypto_random_object_id
9-
from crawlee.storage_clients import BaseStorageClient
9+
from crawlee.storage_clients import StorageClient
1010

1111
from apify._utils import docs_group
1212
from apify.apify_storage_client._dataset_client import DatasetClient
@@ -21,7 +21,7 @@
2121

2222

2323
@docs_group('Classes')
24-
class ApifyStorageClient(BaseStorageClient):
24+
class ApifyStorageClient(StorageClient):
2525
"""A storage client implementation based on the Apify platform storage."""
2626

2727
def __init__(self, *, configuration: Configuration) -> None:
@@ -68,5 +68,5 @@ async def purge_on_start(self) -> None:
6868
pass
6969

7070
@override
71-
def get_rate_limit_errors(self) -> dict[int, int]: # type: ignore[misc]
71+
def get_rate_limit_errors(self) -> dict[int, int]:
7272
return self._apify_client.stats.rate_limit_errors

src/apify/apify_storage_client/_dataset_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import override
66

7-
from crawlee.storage_clients._base import BaseDatasetClient
7+
from crawlee.storage_clients._base import DatasetClient as BaseDatasetClient
88
from crawlee.storage_clients.models import DatasetItemsListPage, DatasetMetadata
99

1010
if TYPE_CHECKING:

src/apify/apify_storage_client/_dataset_collection_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import override
66

7-
from crawlee.storage_clients._base import BaseDatasetCollectionClient
7+
from crawlee.storage_clients._base import DatasetCollectionClient as BaseDatasetCollectionClient
88
from crawlee.storage_clients.models import DatasetListPage, DatasetMetadata
99

1010
if TYPE_CHECKING:

src/apify/apify_storage_client/_key_value_store_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from typing_extensions import override
77

8-
from crawlee.storage_clients._base import BaseKeyValueStoreClient
8+
from crawlee.storage_clients._base import KeyValueStoreClient as BaseKeyValueStoreClient
99
from crawlee.storage_clients.models import KeyValueStoreListKeysPage, KeyValueStoreMetadata, KeyValueStoreRecord
1010

1111
if TYPE_CHECKING:

src/apify/apify_storage_client/_key_value_store_collection_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import override
66

7-
from crawlee.storage_clients._base import BaseKeyValueStoreCollectionClient
7+
from crawlee.storage_clients._base import KeyValueStoreCollectionClient as BaseKeyValueStoreCollectionClient
88
from crawlee.storage_clients.models import KeyValueStoreListPage, KeyValueStoreMetadata
99

1010
if TYPE_CHECKING:

src/apify/apify_storage_client/_request_queue_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing_extensions import override
66

77
from crawlee import Request
8-
from crawlee.storage_clients._base import BaseRequestQueueClient
8+
from crawlee.storage_clients._base import RequestQueueClient as BaseRequestQueueClient
99
from crawlee.storage_clients.models import (
1010
BatchRequestsOperationResponse,
1111
ProcessedRequest,

src/apify/apify_storage_client/_request_queue_collection_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing_extensions import override
66

7-
from crawlee.storage_clients._base import BaseRequestQueueCollectionClient
7+
from crawlee.storage_clients._base import RequestQueueCollectionClient as BaseRequestQueueCollectionClient
88
from crawlee.storage_clients.models import RequestQueueListPage, RequestQueueMetadata
99

1010
if TYPE_CHECKING:

src/apify/storages/_request_list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from crawlee import Request
1212
from crawlee._types import HttpMethod
13-
from crawlee.http_clients import BaseHttpClient, HttpxHttpClient
13+
from crawlee.http_clients import HttpClient, HttpxHttpClient
1414
from crawlee.request_loaders import RequestList as CrawleeRequestList
1515

1616
from apify._utils import docs_group
@@ -49,7 +49,7 @@ class RequestList(CrawleeRequestList):
4949
async def open(
5050
name: str | None = None,
5151
request_list_sources_input: list[dict[str, Any]] | None = None,
52-
http_client: BaseHttpClient | None = None,
52+
http_client: HttpClient | None = None,
5353
) -> RequestList:
5454
"""Creates RequestList from Actor input requestListSources.
5555
@@ -78,7 +78,7 @@ async def open(
7878

7979
@staticmethod
8080
async def _create_request_list(
81-
name: str | None, request_list_sources_input: list[dict[str, Any]], http_client: BaseHttpClient | None
81+
name: str | None, request_list_sources_input: list[dict[str, Any]], http_client: HttpClient | None
8282
) -> RequestList:
8383
if not http_client:
8484
http_client = HttpxHttpClient()
@@ -108,7 +108,7 @@ def _create_requests_from_input(simple_url_inputs: list[_SimpleUrlInput]) -> lis
108108

109109
@staticmethod
110110
async def _fetch_requests_from_url(
111-
remote_url_requests_inputs: list[_RequestsFromUrlInput], http_client: BaseHttpClient
111+
remote_url_requests_inputs: list[_RequestsFromUrlInput], http_client: HttpClient
112112
) -> list[Request]:
113113
"""Crete list of requests from url.
114114

0 commit comments

Comments
 (0)