From 331279122a74a102c2c64a60d3a0cec65a9d1c17 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Fri, 10 Oct 2025 11:25:14 +0400 Subject: [PATCH] [aiofiles] Update to 25.1.* Closes: #14858 --- stubs/aiofiles/METADATA.toml | 2 +- stubs/aiofiles/aiofiles/base.pyi | 2 ++ stubs/aiofiles/aiofiles/os.pyi | 2 +- stubs/aiofiles/aiofiles/ospath.pyi | 19 +++++++++++++++---- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/stubs/aiofiles/METADATA.toml b/stubs/aiofiles/METADATA.toml index fdab36a21cca..e3119727954b 100644 --- a/stubs/aiofiles/METADATA.toml +++ b/stubs/aiofiles/METADATA.toml @@ -1,4 +1,4 @@ -version = "24.1.*" +version = "25.1.*" upstream_repository = "https://github.com/Tinche/aiofiles" [tool.stubtest] diff --git a/stubs/aiofiles/aiofiles/base.pyi b/stubs/aiofiles/aiofiles/base.pyi index 4a22ddd6f160..5723a95d6307 100644 --- a/stubs/aiofiles/aiofiles/base.pyi +++ b/stubs/aiofiles/aiofiles/base.pyi @@ -9,6 +9,8 @@ from typing_extensions import Self _T = TypeVar("_T") _V_co = TypeVar("_V_co", covariant=True) +def wrap(func: Callable[..., _T]) -> Callable[..., Awaitable[_T]]: ... + class AsyncBase(Generic[_T]): def __init__(self, file: TextIO | BinaryIO | None, loop: AbstractEventLoop | None, executor: Executor | None) -> None: ... def __aiter__(self) -> Self: ... diff --git a/stubs/aiofiles/aiofiles/os.pyi b/stubs/aiofiles/aiofiles/os.pyi index 1a544a89d0c8..92c3f38008dc 100644 --- a/stubs/aiofiles/aiofiles/os.pyi +++ b/stubs/aiofiles/aiofiles/os.pyi @@ -7,7 +7,7 @@ from os import _ScandirIterator, stat_result from typing import AnyStr, overload from aiofiles import ospath -from aiofiles.ospath import wrap as wrap +from aiofiles.base import wrap as wrap __all__ = [ "path", diff --git a/stubs/aiofiles/aiofiles/ospath.pyi b/stubs/aiofiles/aiofiles/ospath.pyi index efec48722eed..2ef19d974489 100644 --- a/stubs/aiofiles/aiofiles/ospath.pyi +++ b/stubs/aiofiles/aiofiles/ospath.pyi @@ -1,13 +1,24 @@ from _typeshed import FileDescriptorOrPath from asyncio.events import AbstractEventLoop -from collections.abc import Awaitable, Callable from concurrent.futures import Executor from os import PathLike -from typing import AnyStr, TypeVar +from typing import AnyStr -_R = TypeVar("_R") +__all__ = [ + "abspath", + "getatime", + "getctime", + "getmtime", + "getsize", + "exists", + "isdir", + "isfile", + "islink", + "ismount", + "samefile", + "sameopenfile", +] -def wrap(func: Callable[..., _R]) -> Callable[..., Awaitable[_R]]: ... async def exists( path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ... ) -> bool: ...