Фикс типизации

This commit is contained in:
2025-11-26 13:37:30 +03:00
parent 3eaa68c559
commit 064c20f0b1
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "aiohttpx" name = "aiohttpx"
version = "1.2.1" version = "1.2.2"
description = "Custom HTTPX client with aiohttp transport, rate limiter and caching" description = "Custom HTTPX client with aiohttp transport, rate limiter and caching"
readme = "README.md" readme = "README.md"
authors = [ authors = [

View File

@ -17,7 +17,7 @@ def generate_cache_key(request: Request) -> str:
async def cache_response( async def cache_response(
client: Redis[bytes], client: 'Redis[bytes]',
cache_key: str, cache_key: str,
request: Request, request: Request,
response: Response | HTTPXResponse, response: Response | HTTPXResponse,
@ -38,7 +38,7 @@ def get_ttl_from_headers(headers: m.Headers) -> int | None:
async def get_cached_response( async def get_cached_response(
client: Redis[bytes], cache_key: str client: 'Redis[bytes]', cache_key: str
) -> Response | None: ) -> Response | None:
cached_data = await client.get(cache_key) cached_data = await client.get(cache_key)

View File

@ -9,7 +9,7 @@ from aiohttpx.transports.aio import AiohttpTransport
class AsyncRateLimit(AiohttpTransport): class AsyncRateLimit(AiohttpTransport):
def __init__( def __init__(
self, redis: Redis[bytes] | None, key: str | None, limit: int | None self, redis: 'Redis[bytes] | None', key: str | None, limit: int | None
) -> None: ) -> None:
self.transport = AiohttpTransport() self.transport = AiohttpTransport()
self.client = redis self.client = redis