From 7858e6058b51733f526c6c54035b96a370a12ffc Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 22 Apr 2024 11:24:08 -0400 Subject: [PATCH] Bump waitress to 3.0.* (#11803) --- stubs/waitress/METADATA.toml | 2 +- stubs/waitress/waitress/adjustments.pyi | 3 +-- stubs/waitress/waitress/task.pyi | 8 ++++---- stubs/waitress/waitress/utilities.pyi | 2 +- 4 files changed, 7 insertions(+), 8 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/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 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):