Run stubtest on Windows for waitress (#9181)

This commit is contained in:
Avasam
2022-11-13 09:42:20 -05:00
committed by GitHub
parent 005801d34d
commit 82c0ea7bd5
7 changed files with 46 additions and 38 deletions

View File

@@ -27,7 +27,6 @@ waitress.rfc7230.tobytes
waitress.server.BaseWSGIServer.channel_class
waitress.server.BaseWSGIServer.get_server_name
waitress.server.MultiSocketServer.__init__
waitress.server.UnixWSGIServer.get_server_name
waitress.server.WSGIServer
waitress.task.ErrorTask.content_length
waitress.task.ThreadedTaskDispatcher.start_new_thread

View File

@@ -0,0 +1 @@
waitress.server.UnixWSGIServer.get_server_name

View File

@@ -0,0 +1 @@
waitress.server.UnixWSGIServer.get_server_name

View File

@@ -1,2 +1,6 @@
version = "2.1.*"
requires = []
[tool.stubtest]
# linux and darwin are equivalent
platforms = ["linux", "win32"]

View File

@@ -1,13 +1,13 @@
import sys
from collections.abc import Sequence
from socket import socket
from typing import Any
from waitress import wasyncore
from waitress.adjustments import Adjustments
from waitress.channel import HTTPChannel
from waitress.task import Task, ThreadedTaskDispatcher
from . import wasyncore
def create_server(
application: Any,
map: Any | None = ...,
@@ -84,21 +84,22 @@ class TcpWSGIServer(BaseWSGIServer):
def getsockname(self) -> tuple[str, tuple[str, int]]: ...
def set_socket_options(self, conn: socket) -> None: ...
class UnixWSGIServer(BaseWSGIServer):
def __init__(
self,
application: Any,
map: Any | None = ...,
_start: bool = ...,
_sock: Any | None = ...,
dispatcher: Any | None = ...,
adj: Adjustments | None = ...,
sockinfo: Any | None = ...,
**kw: Any,
) -> None: ...
def bind_server_socket(self) -> None: ...
def getsockname(self) -> tuple[str, tuple[str, int]]: ...
def fix_addr(self, addr: Any) -> tuple[str, None]: ...
def get_server_name(self, ip: Any) -> str: ...
if sys.platform != "win32":
class UnixWSGIServer(BaseWSGIServer):
def __init__(
self,
application: Any,
map: Any | None = ...,
_start: bool = ...,
_sock: Any | None = ...,
dispatcher: Any | None = ...,
adj: Adjustments | None = ...,
sockinfo: Any | None = ...,
**kw: Any,
) -> None: ...
def bind_server_socket(self) -> None: ...
def getsockname(self) -> tuple[str, tuple[str, int]]: ...
def fix_addr(self, addr: Any) -> tuple[str, None]: ...
def get_server_name(self, ip: Any) -> str: ...
WSGIServer: TcpWSGIServer

View File

@@ -4,7 +4,7 @@ from socket import socket
from threading import Lock
from typing_extensions import Literal
from . import wasyncore as wasyncore
from waitress import wasyncore as wasyncore
class _triggerbase:
kind: str | None = ...
@@ -18,7 +18,7 @@ class _triggerbase:
def pull_trigger(self, thunk: Callable[[None], object] | None = ...) -> None: ...
def handle_read(self) -> None: ...
if sys.platform == "linux" or sys.platform == "darwin":
if sys.platform != "win32":
class trigger(_triggerbase, wasyncore.file_dispatcher):
kind: str = ...
def __init__(self, map: Mapping[str, _triggerbase]) -> None: ...

View File

@@ -1,3 +1,4 @@
import sys
from collections.abc import Callable, Mapping
from io import BytesIO
from logging import Logger
@@ -5,7 +6,7 @@ from socket import socket
from typing import Any
from typing_extensions import TypeAlias
from . import compat as compat, utilities as utilities
from waitress import compat as compat, utilities as utilities
_Socket: TypeAlias = socket
@@ -77,20 +78,21 @@ class dispatcher_with_send(dispatcher):
def close_all(map: Mapping[int, socket] | None = ..., ignore_all: bool = ...) -> None: ...
class file_wrapper:
fd: BytesIO = ...
def __init__(self, fd: BytesIO) -> None: ...
def __del__(self) -> None: ...
def recv(self, *args: Any) -> bytes: ...
def send(self, *args: Any) -> bytes: ...
def getsockopt(self, level: int, optname: int, buflen: bool | None = ...) -> int: ...
read: Callable[..., bytes] = ...
write: Callable[..., bytes] = ...
def close(self) -> None: ...
def fileno(self) -> BytesIO: ...
if sys.platform != "win32":
class file_wrapper:
fd: BytesIO = ...
def __init__(self, fd: BytesIO) -> None: ...
def __del__(self) -> None: ...
def recv(self, *args: Any) -> bytes: ...
def send(self, *args: Any) -> bytes: ...
def getsockopt(self, level: int, optname: int, buflen: bool | None = ...) -> int: ...
read: Callable[..., bytes] = ...
write: Callable[..., bytes] = ...
def close(self) -> None: ...
def fileno(self) -> BytesIO: ...
class file_dispatcher(dispatcher):
connected: bool = ...
def __init__(self, fd: BytesIO, map: Mapping[int, _Socket] | None = ...) -> None: ...
socket: _Socket = ...
def set_file(self, fd: BytesIO) -> None: ...
class file_dispatcher(dispatcher):
connected: bool = ...
def __init__(self, fd: BytesIO, map: Mapping[int, _Socket] | None = ...) -> None: ...
socket: _Socket = ...
def set_file(self, fd: BytesIO) -> None: ...