Skip to content

Commit 9840d38

Browse files
[gunicorn] Update to 25.3.0 (#15563)
1 parent 5a5912b commit 9840d38

File tree

5 files changed

+55
-54
lines changed

5 files changed

+55
-54
lines changed

stubs/gunicorn/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "25.2.0"
1+
version = "25.3.0"
22
upstream_repository = "https://github.com/benoitc/gunicorn"
33
requires = ["types-gevent"]
44

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from gunicorn.asgi.lifespan import LifespanManager as LifespanManager
2-
from gunicorn.asgi.message import AsyncRequest as AsyncRequest
32
from gunicorn.asgi.unreader import AsyncUnreader as AsyncUnreader
43

5-
__all__ = ["AsyncUnreader", "AsyncRequest", "LifespanManager"]
4+
__all__ = ["AsyncUnreader", "LifespanManager"]

stubs/gunicorn/gunicorn/asgi/message.pyi

Lines changed: 0 additions & 50 deletions
This file was deleted.

stubs/gunicorn/gunicorn/asgi/parser.pyi

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,57 @@
11
from collections.abc import Callable, Iterable
2-
from typing import Any, Literal, SupportsIndex
2+
from enum import IntEnum
3+
from typing import Any, Final, Literal, SupportsIndex, TypedDict, type_check_only
34
from typing_extensions import Self, TypeAlias
45

56
_H1CProtocol: TypeAlias = Any # gunicorn_h1c H1CProtocol class
67

78
class ParseError(Exception): ...
9+
class InvalidProxyLine(ParseError): ...
10+
class InvalidProxyHeader(ParseError): ...
11+
12+
PP_V2_SIGNATURE: Final[bytes]
13+
14+
class PPCommand(IntEnum):
15+
LOCAL = 0x0
16+
PROXY = 0x1
17+
18+
class PPFamily(IntEnum):
19+
UNSPEC = 0x0
20+
INET = 0x1
21+
INET6 = 0x2
22+
UNIX = 0x3
23+
24+
class PPProtocol(IntEnum):
25+
UNSPEC = 0x0
26+
STREAM = 0x1
27+
DGRAM = 0x2
28+
829
class LimitRequestLine(ParseError): ...
30+
class InvalidRequestLine(ParseError): ...
931
class LimitRequestHeaders(ParseError): ...
1032
class InvalidRequestMethod(ParseError): ...
1133
class InvalidHTTPVersion(ParseError): ...
1234
class InvalidHeaderName(ParseError): ...
1335
class InvalidHeader(ParseError): ...
36+
class UnsupportedTransferCoding(ParseError): ...
37+
class InvalidChunkSize(ParseError): ...
38+
class InvalidChunkExtension(ParseError): ...
39+
40+
@type_check_only
41+
class _ProxyProtocolInfo(TypedDict):
42+
proxy_protocol: Literal["TCP4", "TCP6", "UDP4", "UDP6"]
43+
client_addr: str
44+
client_port: int
45+
proxy_addr: str
46+
proxy_port: int
47+
48+
@type_check_only
49+
class _ProxyProtocolInfoUnknown(TypedDict):
50+
proxy_protocol: Literal["UNKNOWN", "LOCAL", "UNSPEC"]
51+
client_addr: None
52+
client_port: None
53+
proxy_addr: None
54+
proxy_port: None
1455

1556
class PythonProtocol:
1657
__slots__ = (
@@ -42,6 +83,9 @@ class PythonProtocol:
4283
"_permit_unconventional_http_method",
4384
"_permit_unconventional_http_version",
4485
"_header_count",
86+
"_proxy_protocol",
87+
"_proxy_protocol_info",
88+
"_proxy_protocol_done",
4589
)
4690
method: bytes | None
4791
path: bytes | None
@@ -65,9 +109,13 @@ class PythonProtocol:
65109
limit_request_field_size: int = 8190,
66110
permit_unconventional_http_method: bool = False,
67111
permit_unconventional_http_version: bool = False,
112+
proxy_protocol: Literal["off", "v1", "v2", "auto"] = "off",
68113
) -> None: ...
69114
def feed(self, data: Iterable[SupportsIndex]) -> None: ...
115+
@property
116+
def proxy_protocol_info(self) -> _ProxyProtocolInfo | _ProxyProtocolInfoUnknown | None: ...
70117
def reset(self) -> None: ...
118+
def finish(self) -> None: ...
71119

72120
class CallbackRequest:
73121
__slots__ = (

stubs/gunicorn/gunicorn/http/errors.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class ChunkMissingTerminator(IOError):
6868

6969
def __init__(self, term: bytes) -> None: ...
7070

71+
class InvalidChunkExtension(IOError):
72+
reason: str
73+
def __init__(self, reason: str) -> None: ...
74+
7175
class LimitRequestLine(ParseException):
7276
size: int
7377
max_size: int | None

0 commit comments

Comments
 (0)