From 1f7c756cc8b8055509ea4ca8df94667561ae8cb6 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 21 Apr 2024 13:46:21 -0400 Subject: [PATCH 1/2] Bump waitress to 3.0.* --- stubs/waitress/METADATA.toml | 2 +- stubs/waitress/waitress/task.pyi | 8 ++++---- stubs/waitress/waitress/utilities.pyi | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stubs/waitress/METADATA.toml b/stubs/waitress/METADATA.toml index bb43db9f27e1..cc1f5426ff45 100644 --- a/stubs/waitress/METADATA.toml +++ b/stubs/waitress/METADATA.toml @@ -1,4 +1,4 @@ -version = "2.1.*" +version = "3.0.*" upstream_repository = "https://github.com/Pylons/waitress" [tool.stubtest] diff --git a/stubs/waitress/waitress/task.pyi b/stubs/waitress/waitress/task.pyi index 837cd679fab3..8e7d92637755 100644 --- a/stubs/waitress/waitress/task.pyi +++ b/stubs/waitress/waitress/task.pyi @@ -1,9 +1,9 @@ from _typeshed import Unused +from _typeshed.wsgi import WSGIEnvironment from collections import deque from collections.abc import Callable, Mapping, Sequence from logging import Logger from threading import Condition, Lock -from typing import Any from .channel import HTTPChannel from .utilities import Error @@ -47,6 +47,7 @@ class Task: def service(self) -> None: ... @property def has_body(self) -> bool: ... + def set_close_on_finish(self) -> None: ... def build_response_header(self) -> bytes: ... def remove_content_length_header(self) -> None: ... def start(self) -> None: ... @@ -61,12 +62,11 @@ class ErrorTask(Task): def execute(self) -> None: ... class WSGITask(Task): - # Environment dict union too complex - environ: dict[str, Any] | None + environ: WSGIEnvironment | None response_headers: Sequence[tuple[str, str]] complete: bool status: str content_length: int | None close_on_finish: bool def execute(self) -> None: ... - def get_environment(self) -> dict[str, Any]: ... + def get_environment(self) -> WSGIEnvironment: ... diff --git a/stubs/waitress/waitress/utilities.pyi b/stubs/waitress/waitress/utilities.pyi index 9bf8434fc6d6..9449fceaa79f 100644 --- a/stubs/waitress/waitress/utilities.pyi +++ b/stubs/waitress/waitress/utilities.pyi @@ -44,7 +44,7 @@ class Error: reason: str body: str def __init__(self, body: str) -> None: ... - def to_response(self) -> tuple[str, Sequence[tuple[str, str]], str]: ... + def to_response(self, ident: str | None = None) -> tuple[str, Sequence[tuple[str, str]], str]: ... def wsgi_response(self, environ: Unused, start_response: StartResponse) -> Iterator[str]: ... class BadRequest(Error): From 1b678d4f246ea79b19bda07cd814cdff6207dc12 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Apr 2024 10:50:53 -0400 Subject: [PATCH 2/2] Remove _bool_marker --- stubs/waitress/waitress/adjustments.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stubs/waitress/waitress/adjustments.pyi b/stubs/waitress/waitress/adjustments.pyi index 8e909583d65c..cd22f72bf0fb 100644 --- a/stubs/waitress/waitress/adjustments.pyi +++ b/stubs/waitress/waitress/adjustments.pyi @@ -21,7 +21,6 @@ def as_socket_list(sockets: Sequence[object]) -> list[socket]: ... class _str_marker(str): ... class _int_marker(int): ... -class _bool_marker: ... class Adjustments: host: _str_marker @@ -32,7 +31,7 @@ class Adjustments: trusted_proxy_count: int | None trusted_proxy_headers: set[str] log_untrusted_proxy_headers: bool - clear_untrusted_proxy_headers: type[_bool_marker] | bool + clear_untrusted_proxy_headers: bool url_scheme: str url_prefix: str ident: str