Bump gevent to 24.10.* (#12779)

This commit is contained in:
David Salvisberg
2024-10-11 16:24:41 +02:00
committed by GitHub
parent 03fe755ec1
commit 2d31815232
6 changed files with 29 additions and 6 deletions

View File

@@ -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__

View File

@@ -1,4 +1,4 @@
version = "24.2.*"
version = "24.10.*"
upstream_repository = "https://github.com/gevent/gevent"
requires = ["types-greenlet", "types-psutil"]

View File

@@ -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: ...

View 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: ...

View File

@@ -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: ...

View File

@@ -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