mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Bump gevent to 24.10.* (#12779)
This commit is contained in:
@@ -221,3 +221,7 @@ gevent._types
|
||||
# useful way to use it as a keyword argument; we mark it positional-only.
|
||||
gevent.pool.GroupMappingMixin.imap
|
||||
gevent.pool.GroupMappingMixin.imap_unordered
|
||||
|
||||
# Importing gevent.monkey.__main__ leads to issues in stubtest, since gevent will
|
||||
# try to monkeypatch stubtest
|
||||
gevent.monkey.__main__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version = "24.2.*"
|
||||
version = "24.10.*"
|
||||
upstream_repository = "https://github.com/gevent/gevent"
|
||||
requires = ["types-greenlet", "types-psutil"]
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
from types import ModuleType
|
||||
from typing import Any
|
||||
|
||||
from gevent.monkey.api import get_original as get_original, patch_module as patch_module
|
||||
|
||||
class MonkeyPatchWarning(RuntimeWarning): ...
|
||||
|
||||
def is_module_patched(mod_name: str) -> bool: ...
|
||||
def is_object_patched(mod_name: str, item_name: str) -> bool: ...
|
||||
def get_original(mod_name: str, item_name: str) -> Any: ...
|
||||
def patch_module(target_module: ModuleType, source_module: ModuleType, items: list[str] | None = None) -> bool: ...
|
||||
def patch_os() -> None: ...
|
||||
def patch_queue() -> None: ...
|
||||
def patch_time() -> None: ...
|
||||
7
stubs/gevent/gevent/monkey/api.pyi
Normal file
7
stubs/gevent/gevent/monkey/api.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from types import ModuleType
|
||||
from typing import Any
|
||||
|
||||
def get_original(mod_name: str, item_name: str) -> Any: ...
|
||||
def patch_item(module: ModuleType, attr: str, newitem: object) -> None: ...
|
||||
def remove_item(module: ModuleType, attr: str) -> None: ...
|
||||
def patch_module(target_module: ModuleType, source_module: ModuleType, items: list[str] | None = None) -> bool: ...
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from collections import deque
|
||||
from collections.abc import Iterable
|
||||
|
||||
@@ -9,7 +10,12 @@ from typing_extensions import Self
|
||||
from gevent._waiter import Waiter
|
||||
from gevent.hub import Hub
|
||||
|
||||
__all__ = ["Queue", "PriorityQueue", "LifoQueue", "SimpleQueue", "JoinableQueue", "Channel", "Empty", "Full"]
|
||||
__all__ = ["Queue", "PriorityQueue", "LifoQueue", "SimpleQueue", "JoinableQueue", "Channel", "Empty", "Full", "ShutDown"]
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
from queue import ShutDown as ShutDown
|
||||
else:
|
||||
class ShutDown(Exception): ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -19,6 +25,7 @@ class Queue(Generic[_T]):
|
||||
@property
|
||||
def queue(self) -> deque[_T]: ... # readonly in Cython
|
||||
maxsize: int | None
|
||||
is_shutdown: bool
|
||||
@overload
|
||||
def __init__(self, maxsize: int | None = None) -> None: ...
|
||||
@overload
|
||||
@@ -35,6 +42,7 @@ class Queue(Generic[_T]):
|
||||
def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
def shutdown(self, immediate: bool = False) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
from typing import Any, Literal, TypeVar, overload
|
||||
from typing import Any, Literal, Protocol, TypeVar, overload
|
||||
from typing_extensions import ParamSpec, Self
|
||||
|
||||
from gevent._types import _TimerWatcher
|
||||
@@ -11,6 +11,10 @@ _T2 = TypeVar("_T2")
|
||||
_TimeoutT = TypeVar("_TimeoutT", bound=Timeout)
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
class _HasSeconds(Protocol):
|
||||
@property
|
||||
def seconds(self) -> float | int: ...
|
||||
|
||||
class Timeout(BaseException):
|
||||
seconds: float | None
|
||||
exception: type[BaseException] | BaseException | None
|
||||
@@ -39,6 +43,7 @@ class Timeout(BaseException):
|
||||
def __exit__(
|
||||
self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None
|
||||
) -> Literal[True] | None: ...
|
||||
def __lt__(self, other: _HasSeconds | float) -> bool: ...
|
||||
|
||||
# when timeout_value is provided we unfortunately get no type checking on *args, **kwargs, because
|
||||
# ParamSpec does not allow mixing in additional keyword arguments
|
||||
|
||||
Reference in New Issue
Block a user