Bump aiofiles to 23.2.* (#10584)

This commit is contained in:
Sebastian Rittau
2023-08-16 13:05:42 +02:00
committed by GitHub
parent ca157cc3c1
commit 695d41f487
7 changed files with 42 additions and 7 deletions

View File

@@ -93,6 +93,3 @@ aiofiles.tempfile.temptypes.AsyncTemporaryDirectory.cleanup
# Metaclass differs:
aiofiles.base.AiofilesContextManager
aiofiles.tempfile.AiofilesContextManagerTempDir
# Helper decorator, too complex to type
aiofiles.os.wrap

View File

@@ -0,0 +1,5 @@
# At runtime, __all__ includes some items that are not available on Windows.
# https://github.com/Tinche/aiofiles/pull/174
aiofiles.os.__all__
aiofiles.os.sendfile
aiofiles.os.statvfs

View File

@@ -1,4 +1,4 @@
version = "23.1.*"
version = "23.2.*"
upstream_repository = "https://github.com/Tinche/aiofiles"
[tool.stubtest]

View File

@@ -6,6 +6,31 @@ from os import _ScandirIterator, stat_result
from typing import Any, AnyStr, overload
from aiofiles import ospath
from aiofiles.ospath import wrap as wrap
__all__ = [
"path",
"stat",
"rename",
"renames",
"replace",
"remove",
"unlink",
"mkdir",
"makedirs",
"rmdir",
"removedirs",
"link",
"symlink",
"readlink",
"listdir",
"scandir",
"access",
"wrap",
]
if sys.platform != "win32":
__all__ += ["statvfs", "sendfile"]
path = ospath
@@ -90,8 +115,13 @@ async def listdir(path: StrPath | None, *, loop: AbstractEventLoop | None = ...,
async def listdir(path: BytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[bytes]: ...
@overload
async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[str]: ...
async def access(
path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True
) -> bool: ...
if sys.platform != "win32":
from os import statvfs_result
@overload
async def sendfile(
out_fd: int, in_fd: int, offset: int | None, count: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
@@ -109,3 +139,4 @@ if sys.platform != "win32":
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
) -> int: ... # FreeBSD and Mac OS X only
async def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only

View File

@@ -1,7 +1,11 @@
from _typeshed import FileDescriptorOrPath
from asyncio.events import AbstractEventLoop
from typing import Any
from collections.abc import Awaitable, Callable
from typing import Any, TypeVar
_R = TypeVar("_R")
def wrap(func: Callable[..., _R]) -> Callable[..., Awaitable[_R]]: ...
async def exists(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
async def isfile(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
async def isdir(s: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...

View File

@@ -2,7 +2,6 @@ from _typeshed import Incomplete, OpenBinaryMode
from asyncio import AbstractEventLoop
from collections.abc import Generator, Iterable
from tempfile import TemporaryDirectory
from types import coroutine as coroutine
from typing import TypeVar
from aiofiles.base import AsyncBase as AsyncBase

View File

@@ -1,5 +1,4 @@
from collections.abc import Callable
from types import coroutine as coroutine
from typing import TypeVar
_T = TypeVar("_T", bound=type)