Skip to content

[aiofiles] Remove from pyrightconfig #14310

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"stdlib/tkinter/scrolledtext.pyi",
"stdlib/tkinter/tix.pyi",
"stdlib/tkinter/ttk.pyi",
"stubs/aiofiles",
"stubs/antlr4-python3-runtime",
"stubs/auth0-python",
"stubs/Authlib",
Expand Down
8 changes: 6 additions & 2 deletions stubs/aiofiles/aiofiles/base.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from asyncio.events import AbstractEventLoop
from collections.abc import Awaitable, Callable, Generator
from concurrent.futures import Executor
from contextlib import AbstractAsyncContextManager
from types import TracebackType
from typing import Any, BinaryIO, Generic, TextIO, TypeVar
Expand All @@ -8,12 +10,14 @@ _T = TypeVar("_T")
_V_co = TypeVar("_V_co", covariant=True)

class AsyncBase(Generic[_T]):
def __init__(self, file: TextIO | BinaryIO | None, loop: Any, executor: Any) -> None: ...
def __init__(self, file: TextIO | BinaryIO | None, loop: AbstractEventLoop | None, executor: Executor | None) -> None: ...
def __aiter__(self) -> Self: ...
async def __anext__(self) -> _T: ...

class AsyncIndirectBase(AsyncBase[_T]):
def __init__(self, name: str, loop: Any, executor: Any, indirect: Callable[[], TextIO | BinaryIO]) -> None: ...
def __init__(
self, name: str, loop: AbstractEventLoop | None, executor: Executor | None, indirect: Callable[[], TextIO | BinaryIO]
) -> None: ...

class AiofilesContextManager(Awaitable[_V_co], AbstractAsyncContextManager[_V_co]):
def __init__(self, coro: Awaitable[_V_co]) -> None: ...
Expand Down
67 changes: 45 additions & 22 deletions stubs/aiofiles/aiofiles/os.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import sys
from _typeshed import BytesPath, FileDescriptorOrPath, GenericPath, ReadableBuffer, StrOrBytesPath, StrPath
from asyncio.events import AbstractEventLoop
from collections.abc import Sequence
from concurrent.futures import Executor
from os import _ScandirIterator, stat_result
from typing import Any, AnyStr, overload
from typing import AnyStr, overload

from aiofiles import ospath
from aiofiles.ospath import wrap as wrap
Expand Down Expand Up @@ -41,7 +42,7 @@ async def stat(
dir_fd: int | None = None,
follow_symlinks: bool = True,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> stat_result: ...
async def rename(
src: StrOrBytesPath,
Expand All @@ -50,10 +51,10 @@ async def rename(
src_dir_fd: int | None = None,
dst_dir_fd: int | None = None,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> None: ...
async def renames(
old: StrOrBytesPath, new: StrOrBytesPath, loop: AbstractEventLoop | None = ..., executor: Any = ...
old: StrOrBytesPath, new: StrOrBytesPath, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> None: ...
async def replace(
src: StrOrBytesPath,
Expand All @@ -62,19 +63,29 @@ async def replace(
src_dir_fd: int | None = None,
dst_dir_fd: int | None = None,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> None: ...
async def remove(
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Any = ...
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> None: ...
async def unlink(
path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ...
path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> None: ...
async def mkdir(
path: StrOrBytesPath, mode: int = 511, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Any = ...
path: StrOrBytesPath,
mode: int = 511,
*,
dir_fd: int | None = None,
loop: AbstractEventLoop | None = ...,
executor: Executor | None = ...,
) -> None: ...
async def makedirs(
name: StrOrBytesPath, mode: int = 511, exist_ok: bool = False, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
name: StrOrBytesPath,
mode: int = 511,
exist_ok: bool = False,
*,
loop: AbstractEventLoop | None = ...,
executor: Executor | None = ...,
) -> None: ...
async def link(
src: StrOrBytesPath,
Expand All @@ -84,7 +95,7 @@ async def link(
dst_dir_fd: int | None = ...,
follow_symlinks: bool = ...,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> None: ...
async def symlink(
src: StrOrBytesPath,
Expand All @@ -93,29 +104,35 @@ async def symlink(
*,
dir_fd: int | None = ...,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> None: ...
async def readlink(
path: AnyStr, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ...
path: AnyStr, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> AnyStr: ...
async def rmdir(
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Any = ...
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> None: ...
async def removedirs(name: StrOrBytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> None: ...
async def removedirs(name: StrOrBytesPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...) -> None: ...
@overload
async def scandir(path: None = None, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ...
async def scandir(
path: None = None, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> _ScandirIterator[str]: ...
@overload
async def scandir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ...
async def scandir(
path: int, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> _ScandirIterator[str]: ...
@overload
async def scandir(
path: GenericPath[AnyStr], *, loop: AbstractEventLoop | None = ..., executor: Any = ...
path: GenericPath[AnyStr], *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> _ScandirIterator[AnyStr]: ...
@overload
async def listdir(path: StrPath | None, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[str]: ...
async def listdir(
path: StrPath | None, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> list[str]: ...
@overload
async def listdir(path: BytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[bytes]: ...
async def listdir(path: BytesPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...) -> list[bytes]: ...
@overload
async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> list[str]: ...
async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...) -> list[str]: ...
async def access(
path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True
) -> bool: ...
Expand All @@ -126,7 +143,13 @@ if sys.platform != "win32":

@overload
async def sendfile(
out_fd: int, in_fd: int, offset: int | None, count: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
out_fd: int,
in_fd: int,
offset: int | None,
count: int,
*,
loop: AbstractEventLoop | None = ...,
executor: Executor | None = ...,
) -> int: ...
@overload
async def sendfile(
Expand All @@ -139,6 +162,6 @@ if sys.platform != "win32":
flags: int = ...,
*,
loop: AbstractEventLoop | None = ...,
executor: Any = ...,
executor: Executor | None = ...,
) -> int: ... # FreeBSD and Mac OS X only
async def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only
33 changes: 23 additions & 10 deletions stubs/aiofiles/aiofiles/ospath.pyi
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
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 Any, AnyStr, TypeVar
from typing import AnyStr, 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: ...
async def exists(
path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> bool: ...
async def isfile(
path: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> bool: ...
async def isdir(s: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...) -> bool: ...
async def islink(path: FileDescriptorOrPath) -> bool: ...
async def ismount(path: FileDescriptorOrPath) -> bool: ...
async def getsize(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> int: ...
async def getmtime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ...
async def getatime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ...
async def getctime(filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> float: ...
async def getsize(
filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> int: ...
async def getmtime(
filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> float: ...
async def getatime(
filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> float: ...
async def getctime(
filename: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> float: ...
async def samefile(
f1: FileDescriptorOrPath, f2: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
f1: FileDescriptorOrPath, f2: FileDescriptorOrPath, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
) -> bool: ...
async def sameopenfile(fp1: int, fp2: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> bool: ...
async def sameopenfile(fp1: int, fp2: int, *, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...) -> bool: ...
async def abspath(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
Loading