Skip to content

Commit 251570c

Browse files
authored
Bump gevent to 25.4.* (#13885)
1 parent 1ebbbee commit 251570c

12 files changed

Lines changed: 113 additions & 124 deletions

stubs/gevent/@tests/stubtest_allowlist_darwin.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ gevent.libev.watcher.watcher.feed
1717
# undocumented argument for internal use only
1818
gevent.libev.watcher.watcher.__init__
1919

20-
# ares_host_result always has the same layout, so we set the arguments on __new__
21-
# to reflect that fact, we don't care that the implementation accepts any number
22-
# of arguments
23-
gevent.resolver.cares.ares_host_result.__new__
2420

2521
# we have punted on socket, the gevent version of these functions sometimes use
2622
# named parameters, while the base implementation only allows positional arguments

stubs/gevent/@tests/stubtest_allowlist_linux.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ gevent.libev.watcher.watcher.feed
2424
# undocumented argument for internal use only
2525
gevent.libev.watcher.watcher.__init__
2626

27-
# ares_host_result always has the same layout, so we set the arguments on __new__
28-
# to reflect that fact, we don't care that the implementation accepts any number
29-
# of arguments
30-
gevent.resolver.cares.ares_host_result.__new__
3127

3228
# we have punted on socket, the gevent version of these functions sometimes use
3329
# named parameters, while the base implementation only allows positional arguments

stubs/gevent/@tests/stubtest_allowlist_win32.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ gevent.libev.corecext.*
1919
# these won't work until we find out if we can install libev somehow with choco
2020
gevent.libev.corecffi
2121
gevent.libev.watcher
22-
23-
# these don't work on windows
24-
gevent.ares
25-
gevent.resolver.ares
26-
gevent.resolver.cares
27-
gevent.resolver_ares

stubs/gevent/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "24.11.*"
1+
version = "25.4.*"
22
upstream_repository = "https://github.com/gevent/gevent"
33
requires = ["types-greenlet", "types-psutil"]
44

stubs/gevent/gevent/_config.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class Config:
7272
ares_udp_port: _SettingDescriptor[str | int | None]
7373
ares_tcp_port: _SettingDescriptor[str | int | None]
7474
ares_servers: _SettingDescriptor[Sequence[str] | str | None]
75+
print_blocking_reports: _SettingDescriptor[bool]
7576

7677
class ImportableSetting(Generic[_T]):
7778
default: str | Sequence[str]
@@ -141,6 +142,10 @@ class MaxBlockingTime(FloatSettingMixin, Setting[float]):
141142
default: float
142143
desc: str
143144

145+
class PrintBlockingReports(BoolSettingMixin, Setting[bool]):
146+
default: bool
147+
desc: str
148+
144149
class MonitorMemoryPeriod(FloatSettingMixin, Setting[float]):
145150
default: int
146151
desc: str

stubs/gevent/gevent/ares.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import sys
2-
31
from gevent.resolver.cares import *
42

5-
if sys.platform != "win32":
6-
__all__ = ["channel"]
3+
__all__ = ["channel"]

stubs/gevent/gevent/lock.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ class RLock:
3838
def __enter__(self) -> bool: ...
3939
def release(self) -> None: ...
4040
def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ...
41+
def locked(self) -> bool: ...

stubs/gevent/gevent/pywsgi.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Input:
2828
position: int
2929
chunked_input: bool
3030
chunk_length: int
31+
send_100_continue_enabled: bool
3132
def __init__(
3233
self, rfile: BufferedReader, content_length: int | None, socket: _GeventSocket | None = None, chunked_input: bool = False
3334
) -> None: ...

stubs/gevent/gevent/queue.pyi

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import sys
2+
import types
23
from collections import deque
34
from collections.abc import Iterable
45

56
# technically it is using _PySimpleQueue, which has the same interface as SimpleQueue
6-
from queue import Empty as Empty, Full as Full, SimpleQueue as SimpleQueue
7+
from queue import Empty as Empty, Full as Full
78
from typing import Any, Generic, Literal, TypeVar, final, overload
89
from typing_extensions import Self
910

@@ -19,13 +20,16 @@ else:
1920

2021
_T = TypeVar("_T")
2122

22-
class Queue(Generic[_T]):
23+
class SimpleQueue(Generic[_T]):
2324
@property
2425
def hub(self) -> Hub: ... # readonly in Cython
2526
@property
2627
def queue(self) -> deque[_T]: ... # readonly in Cython
2728
maxsize: int | None
2829
is_shutdown: bool
30+
31+
@classmethod
32+
def __class_getitem__(cls, item: Any, /) -> types.GenericAlias: ...
2933
@overload
3034
def __init__(self, maxsize: int | None = None) -> None: ...
3135
@overload
@@ -42,13 +46,27 @@ class Queue(Generic[_T]):
4246
def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ...
4347
def put_nowait(self, item: _T) -> None: ...
4448
def qsize(self) -> int: ...
45-
def shutdown(self, immediate: bool = False) -> None: ...
4649
def __bool__(self) -> bool: ...
4750
def __iter__(self) -> Self: ...
4851
def __len__(self) -> int: ...
4952
def __next__(self) -> _T: ...
5053
next = __next__
5154

55+
class Queue(SimpleQueue[_T]):
56+
@property
57+
def unfinished_tasks(self) -> int: ... # readonly in Cython
58+
@overload
59+
def __init__(self, maxsize: int | None = None, *, unfinished_tasks: int | None = None) -> None: ...
60+
@overload
61+
def __init__(self, maxsize: int | None, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ...
62+
@overload
63+
def __init__(self, maxsize: int | None = None, *, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ...
64+
def join(self, timeout: float | None = None) -> bool: ...
65+
def task_done(self) -> None: ...
66+
def shutdown(self, immediate: bool = False) -> None: ...
67+
68+
JoinableQueue = Queue
69+
5270
@final
5371
class UnboundQueue(Queue[_T]):
5472
@overload
@@ -61,18 +79,6 @@ class UnboundQueue(Queue[_T]):
6179
class PriorityQueue(Queue[_T]): ...
6280
class LifoQueue(Queue[_T]): ...
6381

64-
class JoinableQueue(Queue[_T]):
65-
@property
66-
def unfinished_tasks(self) -> int: ... # readonly in Cython
67-
@overload
68-
def __init__(self, maxsize: int | None = None, *, unfinished_tasks: int | None = None) -> None: ...
69-
@overload
70-
def __init__(self, maxsize: int | None, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ...
71-
@overload
72-
def __init__(self, maxsize: int | None = None, *, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ...
73-
def join(self, timeout: float | None = None) -> bool: ...
74-
def task_done(self) -> None: ...
75-
7682
class Channel(Generic[_T]):
7783
@property
7884
def getters(self) -> deque[Waiter[Any]]: ... # readonly in Cython
@@ -81,6 +87,8 @@ class Channel(Generic[_T]):
8187
@property
8288
def hub(self) -> Hub: ... # readonly in Cython
8389
def __init__(self, maxsize: Literal[1] = 1) -> None: ...
90+
@classmethod
91+
def __class_getitem__(cls, item: Any, /) -> types.GenericAlias: ...
8492
@property
8593
def balance(self) -> int: ...
8694
def qsize(self) -> Literal[0]: ...
Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
1-
import sys
1+
from collections.abc import Sequence
2+
from typing import TypedDict
23

3-
if sys.platform != "win32":
4-
from collections.abc import Sequence
5-
from typing import TypedDict
4+
from gevent._types import _Watcher
5+
from gevent.hub import Hub
6+
from gevent.resolver import AbstractResolver
7+
from gevent.resolver.cares import channel
68

7-
from gevent._types import _Watcher
8-
from gevent.hub import Hub
9-
from gevent.resolver import AbstractResolver
10-
from gevent.resolver.cares import channel
9+
class _ChannelArgs(TypedDict):
10+
flags: str | int | None
11+
timeout: str | float | None
12+
tries: str | int | None
13+
ndots: str | int | None
14+
udp_port: str | int | None
15+
tcp_port: str | int | None
16+
servers: Sequence[str] | str | None
1117

12-
class _ChannelArgs(TypedDict):
13-
flags: str | int | None
14-
timeout: str | float | None
15-
tries: str | int | None
16-
ndots: str | int | None
17-
udp_port: str | int | None
18-
tcp_port: str | int | None
19-
servers: Sequence[str] | str | None
18+
class Resolver(AbstractResolver):
19+
cares_class: type[channel]
20+
hub: Hub
21+
cares: channel
22+
pid: int
23+
params: _ChannelArgs
24+
fork_watcher: _Watcher
25+
def __init__(
26+
self,
27+
hub: Hub | None = None,
28+
use_environ: bool = True,
29+
*,
30+
flags: str | int | None = None,
31+
timeout: str | float | None = None,
32+
tries: str | int | None = None,
33+
ndots: str | int | None = None,
34+
udp_port: str | int | None = None,
35+
tcp_port: str | int | None = None,
36+
servers: Sequence[str] | str | None = None,
37+
) -> None: ...
38+
def __del__(self) -> None: ...
2039

21-
class Resolver(AbstractResolver):
22-
cares_class: type[channel]
23-
hub: Hub
24-
cares: channel
25-
pid: int
26-
params: _ChannelArgs
27-
fork_watcher: _Watcher
28-
def __init__(
29-
self,
30-
hub: Hub | None = None,
31-
use_environ: bool = True,
32-
*,
33-
flags: str | int | None = None,
34-
timeout: str | float | None = None,
35-
tries: str | int | None = None,
36-
ndots: str | int | None = None,
37-
udp_port: str | int | None = None,
38-
tcp_port: str | int | None = None,
39-
servers: Sequence[str] | str | None = None,
40-
) -> None: ...
41-
def __del__(self) -> None: ...
42-
43-
__all__ = ["Resolver"]
40+
__all__ = ["Resolver"]

0 commit comments

Comments
 (0)