Skip to content

Commit

Permalink
Remove typing_extensions dep
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Nov 27, 2024
1 parent 93496a3 commit 6c7beab
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 23 deletions.
8 changes: 1 addition & 7 deletions aiobotocore-stubs/args.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Type annotations for aiobotocore.args module.
Copyright 2024 Vlad Emelianov
"""

import sys
from typing import Any
from typing import Any, TypedDict

from aiobotocore.endpoint import AioEndpoint
from botocore.args import ClientArgsCreator
Expand All @@ -19,11 +18,6 @@ from botocore.parsers import ResponseParser
from botocore.serialize import BaseRestSerializer
from botocore.signers import RequestSigner

if sys.version_info >= (3, 12):
from typing import TypedDict
else:
from typing_extensions import TypedDict

class _GetClientArgsTypeDef(TypedDict):
serializer: BaseRestSerializer
endpoint: AioEndpoint
Expand Down
7 changes: 4 additions & 3 deletions aiobotocore-stubs/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ Copyright 2024 Vlad Emelianov
"""

from types import TracebackType
from typing import Any
from typing import Any, TypeVar

from aiobotocore.paginate import AioPaginator
from aiobotocore.waiter import AIOWaiter
from botocore.client import BaseClient, ClientCreator
from botocore.config import Config
from botocore.history import HistoryRecorder
from typing_extensions import Self

_R = TypeVar("_R")

history_recorder: HistoryRecorder

Expand All @@ -34,7 +35,7 @@ class AioClientCreator(ClientCreator):
class AioBaseClient(BaseClient):
def get_paginator(self, operation_name: str) -> AioPaginator: ...
def get_waiter(self, waiter_name: str) -> AIOWaiter: ...
async def __aenter__(self) -> Self: ...
async def __aenter__(self: _R) -> _R: ...
async def __aexit__(
self,
exc_type: type[BaseException] | None,
Expand Down
7 changes: 4 additions & 3 deletions aiobotocore-stubs/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Type annotations for aiobotocore.config module.
Copyright 2024 Vlad Emelianov
"""

from typing import Any
from typing import Any, TypeVar

from aiobotocore.httpsession import AIOHTTPSession
from botocore.config import Config
from typing_extensions import Self

_Config = TypeVar("_Config", bound=Config)

class AioConfig(Config):
def __init__(
self, connector_args: Any = ..., http_session_cls: type[AIOHTTPSession] = ..., **kwargs: Any
) -> None: ...
def merge(self, other_config: Config) -> Self: ...
def merge(self: _Config, other_config: _Config) -> _Config: ...
7 changes: 4 additions & 3 deletions aiobotocore-stubs/httpchecksum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ Type annotations for aiobotocore.httpchecksum module.
Copyright 2024 Vlad Emelianov
"""

from typing import Any, Mapping
from typing import Any, Mapping, TypeVar

from aiobotocore.response import StreamingBody
from aiohttp import StreamReader
from botocore.awsrequest import AWSHTTPResponse, AWSRequest
from botocore.httpchecksum import AwsChunkedWrapper, BaseChecksum
from botocore.model import OperationModel
from typing_extensions import Self

_R = TypeVar("_R")

class AioAwsChunkedWrapper(AwsChunkedWrapper):
async def _make_chunk(self) -> bytes: ...
def __aiter__(self) -> Self: ...
def __aiter__(self: _R) -> _R: ...
async def __anext__(self) -> bytes: ...

class StreamingChecksumBody(StreamingBody):
Expand Down
7 changes: 4 additions & 3 deletions aiobotocore-stubs/httpsession.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ Copyright 2024 Vlad Emelianov
"""

from types import TracebackType
from typing import Any
from typing import Any, TypeVar

from botocore.endpoint import MAX_POOL_CONNECTIONS as MAX_POOL_CONNECTIONS
from requests.models import Request, Response
from typing_extensions import Self

_R = TypeVar("_R")

class AIOHTTPSession:
def __init__(
Expand All @@ -23,7 +24,7 @@ class AIOHTTPSession:
proxies_config: Any | None = ...,
connector_args: Any | None = ...,
) -> None: ...
async def __aenter__(self) -> Self: ...
async def __aenter__(self: _R) -> _R: ...
async def __aexit__(
self,
exc_type: type[BaseException] | None,
Expand Down
7 changes: 4 additions & 3 deletions aiobotocore-stubs/response.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ Copyright 2024 Vlad Emelianov

import asyncio
from types import TracebackType
from typing import IO, Any, AsyncIterator
from typing import IO, Any, AsyncIterator, TypeVar

import wrapt # type: ignore
from aiobotocore import parsers as parsers
from botocore.exceptions import ReadTimeoutError
from botocore.model import OperationModel
from requests.models import Response
from typing_extensions import Self

_R = TypeVar("_R")

class AioReadTimeoutError(ReadTimeoutError, asyncio.TimeoutError): ...

class StreamingBody(wrapt.ObjectProxy): # type: ignore
def __init__(self, raw_stream: IO[bytes], content_length: int) -> None: ...
async def __aenter__(self) -> Self: ...
async def __aenter__(self: _R) -> _R: ...
async def __aexit__(
self,
exc_type: type[BaseException] | None,
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ classifiers = [
"Typing :: Stubs Only",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["typing-extensions>=4.1.0; python_version<'3.9'"]

[tool.uv]
config-settings = { editable-mode = "strict" }
Expand Down

0 comments on commit 6c7beab

Please sign in to comment.