Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator

from typing_extensions import Unpack
from typing import Unpack

from crawlee.crawlers._abstract_http import ParsedHttpCrawlingContext

Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
import re
from collections.abc import Awaitable, Coroutine, MutableMapping, Sequence
from datetime import timedelta
from typing import NotRequired, Required, Self

from typing_extensions import Unpack
from typing import NotRequired, Required, Self, Unpack

from crawlee import Glob, Request
from crawlee._request import RequestOptions
Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/_utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncIterator, Mapping
from typing import Any, TextIO

from typing_extensions import Unpack
from typing import Any, TextIO, Unpack

from crawlee._types import ExportDataCsvKwargs, ExportDataJsonKwargs, JsonSerializable

Expand Down
3 changes: 1 addition & 2 deletions src/crawlee/_utils/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

if TYPE_CHECKING:
from collections.abc import Mapping, Sequence
from typing import NotRequired
from typing import NotRequired, Unpack

from lxml.html import HtmlElement
from typing_extensions import Unpack

from crawlee._types import JsonSerializable

Expand Down
3 changes: 2 additions & 1 deletion src/crawlee/browsers/_stagehand_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from crawlee._utils.docs import docs_group

if TYPE_CHECKING:
from typing import Unpack

from stagehand import AsyncSession
from stagehand.types.session_act_params import SessionActParamsNonStreaming
from stagehand.types.session_act_response import SessionActResponse
Expand All @@ -17,7 +19,6 @@
from stagehand.types.session_extract_response import SessionExtractResponse
from stagehand.types.session_observe_params import SessionObserveParamsNonStreaming
from stagehand.types.session_observe_response import SessionObserveResponse
from typing_extensions import Unpack


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Awaitable, Callable, Iterator, Mapping

from typing_extensions import Unpack
from typing import Unpack

from crawlee import RequestTransformAction
from crawlee._types import BasicCrawlingContext, EnqueueLinksKwargs, ExtractLinksFunction, JsonSerializable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from __future__ import annotations

from dataclasses import dataclass, fields
from typing import Generic, Self

from typing_extensions import TypeVar
from typing import Generic, Self, TypeVar

from crawlee._types import BasicCrawlingContext, EnqueueLinksFunction, ExtractLinksFunction, PageSnapshot
from crawlee._utils.docs import docs_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from dataclasses import dataclass
from logging import getLogger
from random import random
from typing import TYPE_CHECKING, Any, Generic, Self, get_args
from typing import TYPE_CHECKING, Any, Generic, Self, TypeVar, get_args

from bs4 import BeautifulSoup, Tag
from parsel import Selector
from typing_extensions import TypeVar, override
from typing_extensions import override

from crawlee._types import BasicCrawlingContext, ConcurrencySettings, JsonSerializable, RequestHandlerRunResult
from crawlee._utils.docs import docs_group
Expand Down Expand Up @@ -45,8 +45,7 @@
if TYPE_CHECKING:
from collections.abc import MutableMapping
from types import TracebackType

from typing_extensions import Unpack
from typing import Unpack

from crawlee.crawlers._basic._basic_crawler import _BasicCrawlerOptions

Expand Down
4 changes: 2 additions & 2 deletions src/crawlee/crawlers/_basic/_basic_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
from http import HTTPStatus
from io import StringIO
from pathlib import Path
from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, ParamSpec, cast
from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, ParamSpec, TypedDict, Unpack, cast
from weakref import WeakKeyDictionary

from cachetools import LRUCache
from typing_extensions import TypedDict, TypeVar, Unpack
from typing_extensions import TypeVar
from yarl import URL

from crawlee import Glob, RequestTransformAction, service_locator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator

from typing_extensions import Unpack
from typing import Unpack

from crawlee.crawlers._abstract_http import ParsedHttpCrawlingContext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

if TYPE_CHECKING:
from collections.abc import Mapping, Sequence
from typing import Self

from typing_extensions import Unpack
from typing import Self, Unpack

from crawlee._request import Request
from crawlee._utils.html import FormRequestOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator

from typing_extensions import Unpack
from typing import Unpack

from crawlee._types import BasicCrawlingContext
from crawlee.crawlers._abstract_http import HttpCrawlerOptions
Expand Down
2 changes: 1 addition & 1 deletion src/crawlee/crawlers/_http/_http_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ._http_parser import NoParser

if TYPE_CHECKING:
from typing_extensions import Unpack
from typing import Unpack

from crawlee.crawlers import BasicCrawlerOptions

Expand Down
3 changes: 1 addition & 2 deletions src/crawlee/crawlers/_parsel/_parsel_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator

from typing_extensions import Unpack
from typing import Unpack

from crawlee.crawlers._abstract_http import ParsedHttpCrawlingContext

Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/crawlers/_parsel/_parsel_crawling_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

if TYPE_CHECKING:
from collections.abc import Mapping, Sequence
from typing import Self

from typing_extensions import Unpack
from typing import Self, Unpack

from crawlee._request import Request
from crawlee._utils.html import FormRequestOptions
Expand Down
6 changes: 3 additions & 3 deletions src/crawlee/crawlers/_playwright/_playwright_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import warnings
from datetime import timedelta
from functools import partial
from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, cast
from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, TypedDict, cast

import playwright.async_api
from more_itertools import partition
from pydantic import ValidationError
from typing_extensions import TypedDict, TypeVar
from typing_extensions import TypeVar

from crawlee._request import Request, RequestOptions, RequestState
from crawlee._types import BasicCrawlingContext, ConcurrencySettings
Expand Down Expand Up @@ -38,9 +38,9 @@
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Awaitable, Callable, Iterator, Mapping
from pathlib import Path
from typing import Unpack

from playwright.async_api import Page, Response
from typing_extensions import Unpack

from crawlee import RequestTransformAction
from crawlee._types import (
Expand Down
2 changes: 1 addition & 1 deletion src/crawlee/crawlers/_pydantic_ai/_pydantic_ai_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

if TYPE_CHECKING:
from collections.abc import AsyncGenerator
from typing import Unpack

from pydantic_ai.models import Model
from typing_extensions import Unpack

from crawlee import Request
from crawlee.crawlers._abstract_http import ParsedHttpCrawlingContext
Expand Down
3 changes: 1 addition & 2 deletions src/crawlee/crawlers/_pydantic_ai/_types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING, Protocol
from typing import TYPE_CHECKING, Protocol, TypeVar

from pydantic import BaseModel
from typing_extensions import TypeVar

from crawlee._utils.docs import docs_group

Expand Down
3 changes: 1 addition & 2 deletions src/crawlee/crawlers/_stagehand/_stagehand_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
if TYPE_CHECKING:
from datetime import timedelta
from pathlib import Path

from typing_extensions import Unpack
from typing import Unpack

from crawlee.browsers import StagehandOptions
from crawlee.crawlers._basic import BasicCrawlerOptions
Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/events/_local_event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

if TYPE_CHECKING:
from types import TracebackType
from typing import Self

from typing_extensions import Unpack
from typing import Self, Unpack

logger = getLogger(__name__)

Expand Down
3 changes: 1 addition & 2 deletions src/crawlee/proxy_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import inspect
from collections import defaultdict
from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Protocol

from more_itertools import flatten
from pydantic import AnyHttpUrl, TypeAdapter
from typing_extensions import Protocol
from yarl import URL

from crawlee._utils.crypto import crypto_random_object_id
Expand Down
4 changes: 1 addition & 3 deletions src/crawlee/storages/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

if TYPE_CHECKING:
from collections.abc import AsyncIterator, Mapping, Sequence
from typing import Any, Literal

from typing_extensions import Unpack
from typing import Any, Literal, Unpack

from crawlee._types import ExportDataCsvKwargs, ExportDataJsonKwargs, JsonSerializable
from crawlee.configuration import Configuration
Expand Down
Loading