Skip to content

Commit 695d41f

Browse files
authored
Bump aiofiles to 23.2.* (#10584)
1 parent ca157cc commit 695d41f

File tree

7 files changed

+42
-7
lines changed

7 files changed

+42
-7
lines changed

stubs/aiofiles/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,3 @@ aiofiles.tempfile.temptypes.AsyncTemporaryDirectory.cleanup
9393
# Metaclass differs:
9494
aiofiles.base.AiofilesContextManager
9595
aiofiles.tempfile.AiofilesContextManagerTempDir
96-
97-
# Helper decorator, too complex to type
98-
aiofiles.os.wrap
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# At runtime, __all__ includes some items that are not available on Windows.
2+
# https://github.com/Tinche/aiofiles/pull/174
3+
aiofiles.os.__all__
4+
aiofiles.os.sendfile
5+
aiofiles.os.statvfs

stubs/aiofiles/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "23.1.*"
1+
version = "23.2.*"
22
upstream_repository = "https://github.com/Tinche/aiofiles"
33

44
[tool.stubtest]

stubs/aiofiles/aiofiles/os.pyi

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ from os import _ScandirIterator, stat_result
66
from typing import Any, AnyStr, overload
77

88
from aiofiles import ospath
9+
from aiofiles.ospath import wrap as wrap
10+
11+
__all__ = [
12+
"path",
13+
"stat",
14+
"rename",
15+
"renames",
16+
"replace",
17+
"remove",
18+
"unlink",
19+
"mkdir",
20+
"makedirs",
21+
"rmdir",
22+
"removedirs",
23+
"link",
24+
"symlink",
25+
"readlink",
26+
"listdir",
27+
"scandir",
28+
"access",
29+
"wrap",
30+
]
31+
32+
if sys.platform != "win32":
33+
__all__ += ["statvfs", "sendfile"]
934

1035
path = ospath
1136

@@ -90,8 +115,13 @@ async def listdir(path: StrPath | None, *, loop: AbstractEventLoop | None = ...,
90115
async def listdir(path: BytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[bytes]: ...
91116
@overload
92117
async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[str]: ...
118+
async def access(
119+
path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True
120+
) -> bool: ...
93121

94122
if sys.platform != "win32":
123+
from os import statvfs_result
124+
95125
@overload
96126
async def sendfile(
97127
out_fd: int, in_fd: int, offset: int | None, count: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
@@ -109,3 +139,4 @@ if sys.platform != "win32":
109139
loop: AbstractEventLoop | None = ...,
110140
executor: Any = ...,
111141
) -> int: ... # FreeBSD and Mac OS X only
142+
async def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only

stubs/aiofiles/aiofiles/ospath.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
from _typeshed import FileDescriptorOrPath
22
from asyncio.events import AbstractEventLoop
3-
from typing import Any
3+
from collections.abc import Awaitable, Callable
4+
from typing import Any, TypeVar
45

6+
_R = TypeVar("_R")
7+
8+
def wrap(func: Callable[..., _R]) -> Callable[..., Awaitable[_R]]: ...
59
async def exists(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
610
async def isfile(path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
711
async def isdir(s: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...

stubs/aiofiles/aiofiles/tempfile/temptypes.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from _typeshed import Incomplete, OpenBinaryMode
22
from asyncio import AbstractEventLoop
33
from collections.abc import Generator, Iterable
44
from tempfile import TemporaryDirectory
5-
from types import coroutine as coroutine
65
from typing import TypeVar
76

87
from aiofiles.base import AsyncBase as AsyncBase

stubs/aiofiles/aiofiles/threadpool/utils.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections.abc import Callable
2-
from types import coroutine as coroutine
32
from typing import TypeVar
43

54
_T = TypeVar("_T", bound=type)

0 commit comments

Comments
 (0)