Skip to content

Bump gevent to 25.4.* #13885

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 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion stubs/gevent/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "24.11.*"
version = "25.4.*"
upstream_repository = "https://github.com/gevent/gevent"
requires = ["types-greenlet", "types-psutil"]

Expand Down
1 change: 1 addition & 0 deletions stubs/gevent/gevent/_config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Config:
ares_udp_port: _SettingDescriptor[str | int | None]
ares_tcp_port: _SettingDescriptor[str | int | None]
ares_servers: _SettingDescriptor[Sequence[str] | str | None]
print_blocking_reports: _SettingDescriptor[bool]

class ImportableSetting(Generic[_T]):
default: str | Sequence[str]
Expand Down
5 changes: 1 addition & 4 deletions stubs/gevent/gevent/ares.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import sys

from gevent.resolver.cares import *

if sys.platform != "win32":
__all__ = ["channel"]
__all__ = ["channel"]
1 change: 1 addition & 0 deletions stubs/gevent/gevent/lock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ class RLock:
def __enter__(self) -> bool: ...
def release(self) -> None: ...
def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ...
def locked(self) -> bool: ...
1 change: 1 addition & 0 deletions stubs/gevent/gevent/pywsgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Input:
position: int
chunked_input: bool
chunk_length: int
send_100_continue_enabled: bool
def __init__(
self, rfile: BufferedReader, content_length: int | None, socket: _GeventSocket | None = None, chunked_input: bool = False
) -> None: ...
Expand Down
22 changes: 15 additions & 7 deletions stubs/gevent/gevent/queue.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import sys
import types
from collections import deque
from collections.abc import Iterable

# technically it is using _PySimpleQueue, which has the same interface as SimpleQueue
from queue import Empty as Empty, Full as Full, SimpleQueue as SimpleQueue
from queue import Empty as Empty, Full as Full
from typing import Any, Generic, Literal, TypeVar, final, overload
from typing_extensions import Self

Expand All @@ -19,13 +20,16 @@ else:

_T = TypeVar("_T")

class Queue(Generic[_T]):
class SimpleQueue(Generic[_T]):
@property
def hub(self) -> Hub: ... # readonly in Cython
@property
def queue(self) -> deque[_T]: ... # readonly in Cython
maxsize: int | None
is_shutdown: bool

@classmethod
def __class_getitem__(cls, item: Any, /) -> types.GenericAlias: ...
@overload
def __init__(self, maxsize: int | None = None) -> None: ...
@overload
Expand All @@ -42,26 +46,25 @@ 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: ...
def __next__(self) -> _T: ...
next = __next__

@final
class UnboundQueue(Queue[_T]):
class UnboundQueue(SimpleQueue[_T]):
@overload
def __init__(self, maxsize: None = None) -> None: ...
@overload
def __init__(self, maxsize: None, items: Iterable[_T]) -> None: ...
@overload
def __init__(self, maxsize: None = None, *, items: Iterable[_T]) -> None: ...

class PriorityQueue(Queue[_T]): ...
class LifoQueue(Queue[_T]): ...
class PriorityQueue(SimpleQueue[_T]): ...
class LifoQueue(SimpleQueue[_T]): ...

class JoinableQueue(Queue[_T]):
class Queue(SimpleQueue[_T]):
@property
def unfinished_tasks(self) -> int: ... # readonly in Cython
@overload
Expand All @@ -72,6 +75,9 @@ class JoinableQueue(Queue[_T]):
def __init__(self, maxsize: int | None = None, *, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ...
def join(self, timeout: float | None = None) -> bool: ...
def task_done(self) -> None: ...
def shutdown(self, immediate: bool = False) -> None: ...

JoinableQueue = Queue

class Channel(Generic[_T]):
@property
Expand All @@ -81,6 +87,8 @@ class Channel(Generic[_T]):
@property
def hub(self) -> Hub: ... # readonly in Cython
def __init__(self, maxsize: Literal[1] = 1) -> None: ...
@classmethod
def __class_getitem__(cls, item: Any, /) -> types.GenericAlias: ...
@property
def balance(self) -> int: ...
def qsize(self) -> Literal[0]: ...
Expand Down
75 changes: 36 additions & 39 deletions stubs/gevent/gevent/resolver/ares.pyi
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
import sys
from collections.abc import Sequence
from typing import TypedDict

if sys.platform != "win32":
from collections.abc import Sequence
from typing import TypedDict
from gevent._types import _Watcher
from gevent.hub import Hub
from gevent.resolver import AbstractResolver
from gevent.resolver.cares import channel

from gevent._types import _Watcher
from gevent.hub import Hub
from gevent.resolver import AbstractResolver
from gevent.resolver.cares import channel
class _ChannelArgs(TypedDict):
flags: str | int | None
timeout: str | float | None
tries: str | int | None
ndots: str | int | None
udp_port: str | int | None
tcp_port: str | int | None
servers: Sequence[str] | str | None

class _ChannelArgs(TypedDict):
flags: str | int | None
timeout: str | float | None
tries: str | int | None
ndots: str | int | None
udp_port: str | int | None
tcp_port: str | int | None
servers: Sequence[str] | str | None
class Resolver(AbstractResolver):
cares_class: type[channel]
hub: Hub
cares: channel
pid: int
params: _ChannelArgs
fork_watcher: _Watcher
def __init__(
self,
hub: Hub | None = None,
use_environ: bool = True,
*,
flags: str | int | None = None,
timeout: str | float | None = None,
tries: str | int | None = None,
ndots: str | int | None = None,
udp_port: str | int | None = None,
tcp_port: str | int | None = None,
servers: Sequence[str] | str | None = None,
) -> None: ...
def __del__(self) -> None: ...

class Resolver(AbstractResolver):
cares_class: type[channel]
hub: Hub
cares: channel
pid: int
params: _ChannelArgs
fork_watcher: _Watcher
def __init__(
self,
hub: Hub | None = None,
use_environ: bool = True,
*,
flags: str | int | None = None,
timeout: str | float | None = None,
tries: str | int | None = None,
ndots: str | int | None = None,
udp_port: str | int | None = None,
tcp_port: str | int | None = None,
servers: Sequence[str] | str | None = None,
) -> None: ...
def __del__(self) -> None: ...

__all__ = ["Resolver"]
__all__ = ["Resolver"]
91 changes: 44 additions & 47 deletions stubs/gevent/gevent/resolver/cares.pyi
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
import sys
from collections.abc import Callable, Sequence
from typing import Any, Generic, TypeVar
from typing_extensions import Self

if sys.platform != "win32":
from collections.abc import Callable, Sequence
from typing import Any, Generic, TypeVar
from typing_extensions import Self
from gevent._types import _AddrinfoResult, _Loop, _NameinfoResult, _SockAddr

from gevent._types import _AddrinfoResult, _Loop, _NameinfoResult, _SockAddr
_T = TypeVar("_T")

_T = TypeVar("_T")
class Result(Generic[_T]):
exception: BaseException | None
value: _T | None
def __init__(self, value: _T | None = None, exception: BaseException | None = None) -> None: ...
def get(self) -> Any | None: ...
def successful(self) -> bool: ...

class Result(Generic[_T]):
exception: BaseException | None
value: _T | None
def __init__(self, value: _T | None = None, exception: BaseException | None = None) -> None: ...
def get(self) -> Any | None: ...
def successful(self) -> bool: ...
class ares_host_result(tuple[str, list[str], list[str]]):
family: int
def __new__(cls, family: int, hostname: str, aliases: list[str], addr_list: list[str], /) -> Self: ...

class ares_host_result(tuple[str, list[str], list[str]]):
family: int
def __new__(cls, family: int, hostname: str, aliases: list[str], addr_list: list[str], /) -> Self: ...
class channel:
@property
def loop(self) -> _Loop: ...
def __init__(
self,
loop: _Loop,
flags: str | int | None = None,
timeout: str | float | None = None,
tries: str | int | None = None,
ndots: str | int | None = None,
udp_port: str | int | None = None,
tcp_port: str | int | None = None,
servers: Sequence[str] | str | None = None,
) -> None: ...
def destroy(self) -> None: ...
def getaddrinfo(
self,
callback: Callable[[Result[_AddrinfoResult]], object],
name: str,
service: str | None,
family: int = 0,
type: int = 0,
proto: int = 0,
flags: int = 0,
) -> None: ...
def gethostbyaddr(self, callback: Callable[[Result[ares_host_result]], object], addr: str) -> Any: ...
def gethostbyname(self, callback: Callable[[Result[ares_host_result]], object], name: str, family: int = ...) -> None: ...
def getnameinfo(self, callback: Callable[[Result[_NameinfoResult]], object], sockaddr: _SockAddr, flags: int) -> None: ...
def set_servers(self, servers: Sequence[str] | str | None = None) -> None: ...

class channel:
@property
def loop(self) -> _Loop: ...
def __init__(
self,
loop: _Loop,
flags: str | int | None = None,
timeout: str | float | None = None,
tries: str | int | None = None,
ndots: str | int | None = None,
udp_port: str | int | None = None,
tcp_port: str | int | None = None,
servers: Sequence[str] | str | None = None,
) -> None: ...
def destroy(self) -> None: ...
def getaddrinfo(
self,
callback: Callable[[Result[_AddrinfoResult]], object],
name: str,
service: str | None,
family: int = 0,
type: int = 0,
proto: int = 0,
flags: int = 0,
) -> None: ...
def gethostbyaddr(self, callback: Callable[[Result[ares_host_result]], object], addr: str) -> Any: ...
def gethostbyname(self, callback: Callable[[Result[ares_host_result]], object], name: str, family: int = ...) -> None: ...
def getnameinfo(self, callback: Callable[[Result[_NameinfoResult]], object], sockaddr: _SockAddr, flags: int) -> None: ...
def set_servers(self, servers: Sequence[str] | str | None = None) -> None: ...

__all__ = ["channel"]
__all__ = ["channel"]
5 changes: 1 addition & 4 deletions stubs/gevent/gevent/resolver_ares.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import sys

from gevent.resolver.ares import *

if sys.platform != "win32":
__all__ = ["Resolver"]
__all__ = ["Resolver"]
Loading