Skip to content

Bump aiofiles to 23.2.* #10584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions stubs/aiofiles/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions stubs/aiofiles/@tests/stubtest_allowlist_win32.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion stubs/aiofiles/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "23.1.*"
version = "23.2.*"
upstream_repository = "https://github.com/Tinche/aiofiles"

[tool.stubtest]
Expand Down
31 changes: 31 additions & 0 deletions stubs/aiofiles/aiofiles/os.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = ...
Expand All @@ -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
6 changes: 5 additions & 1 deletion stubs/aiofiles/aiofiles/ospath.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Expand Down
1 change: 0 additions & 1 deletion stubs/aiofiles/aiofiles/tempfile/temptypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stubs/aiofiles/aiofiles/threadpool/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections.abc import Callable
from types import coroutine as coroutine
from typing import TypeVar

_T = TypeVar("_T", bound=type)
Expand Down