import sphinx.errors
import sys
-import sphinx_rtd_theme
-
# Ensure we get the local copy of tornado instead of what's on the standard path
sys.path.insert(0, os.path.abspath(".."))
import tornado
intersphinx_mapping = {"python": ("https://docs.python.org/3/", None)}
html_theme = "sphinx_rtd_theme"
-html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Suppress warnings about "class reference target not found" for these types.
# In most cases these types come from type annotations and are for mypy's use.
#
# pip-compile
#
-alabaster==0.7.16
+alabaster==1.0.0
# via sphinx
-babel==2.15.0
+babel==2.17.0
# via sphinx
-black==24.4.2
+black==25.1.0
# via -r requirements.in
-build==1.2.1
+build==1.2.2.post1
# via pip-tools
cachetools==5.5.2
# via tox
-certifi==2024.7.4
+certifi==2025.4.26
# via requests
chardet==5.2.0
# via tox
-charset-normalizer==3.3.2
+charset-normalizer==3.4.2
# via requests
-click==8.1.7
+click==8.2.1
# via
# black
# pip-tools
colorama==0.4.6
# via tox
-distlib==0.3.8
+distlib==0.3.9
# via virtualenv
-docutils==0.20.1
+docutils==0.21.2
# via
# sphinx
# sphinx-rtd-theme
# via
# tox
# virtualenv
-flake8==7.0.0
+flake8==7.2.0
# via -r requirements.in
-idna==3.7
+idna==3.10
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.6
# via sphinx
-markupsafe==2.1.5
+markupsafe==3.0.2
# via jinja2
mccabe==0.7.0
# via flake8
-mypy==1.10.0
+mypy==1.15.0
# via -r requirements.in
-mypy-extensions==1.0.0
+mypy-extensions==1.1.0
# via
# black
# mypy
# black
# tox
# virtualenv
-pluggy==1.5.0
+pluggy==1.6.0
# via tox
-pycodestyle==2.11.1
+pycodestyle==2.13.0
# via flake8
-pyflakes==3.2.0
+pyflakes==3.3.2
# via flake8
-pygments==2.18.0
+pygments==2.19.1
# via sphinx
pyproject-api==1.9.1
# via tox
-pyproject-hooks==1.1.0
+pyproject-hooks==1.2.0
# via
# build
# pip-tools
requests==2.32.3
# via sphinx
-snowballstemmer==2.2.0
+roman-numerals-py==3.1.0
# via sphinx
-sphinx==7.3.7
+snowballstemmer==3.0.1
+ # via sphinx
+sphinx==8.2.3
# via
# -r requirements.in
# sphinx-rtd-theme
# sphinxcontrib-jquery
-sphinx-rtd-theme==2.0.0
+sphinx-rtd-theme==3.0.2
# via -r requirements.in
-sphinxcontrib-applehelp==1.0.8
+sphinxcontrib-applehelp==2.0.0
# via sphinx
-sphinxcontrib-devhelp==1.0.6
+sphinxcontrib-devhelp==2.0.0
# via sphinx
-sphinxcontrib-htmlhelp==2.0.5
+sphinxcontrib-htmlhelp==2.1.0
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
-sphinxcontrib-qthelp==1.0.7
+sphinxcontrib-qthelp==2.0.0
# via sphinx
-sphinxcontrib-serializinghtml==1.1.10
+sphinxcontrib-serializinghtml==2.0.0
# via sphinx
tox==4.26.0
# via -r requirements.in
-types-pycurl==7.45.3.20240421
+types-pycurl==7.45.6.20250309
# via -r requirements.in
-typing-extensions==4.12.2
+typing-extensions==4.13.2
# via mypy
-urllib3==2.2.2
+urllib3==2.4.0
# via requests
virtualenv==20.31.2
# via tox
-wheel==0.43.0
+wheel==0.45.1
# via pip-tools
# The following packages are considered to be unsafe in a requirements file:
def _curl_header_callback(
self,
headers: httputil.HTTPHeaders,
- header_callback: Callable[[str], None],
+ header_callback: Optional[Callable[[str], None]],
header_line_bytes: bytes,
) -> None:
header_line = native_str(header_line_bytes.decode("latin1"))
@overload
def coroutine(
- func: Callable[..., "Generator[Any, Any, _T]"]
+ func: Callable[..., "Generator[Any, Any, _T]"],
) -> Callable[..., "Future[_T]"]: ...
def coroutine(
- func: Union[Callable[..., "Generator[Any, Any, _T]"], Callable[..., _T]]
+ func: Union[Callable[..., "Generator[Any, Any, _T]"], Callable[..., _T]],
) -> Callable[..., "Future[_T]"]:
"""Decorator for asynchronous generators.
if max_restarts is None:
max_restarts = 100
- global _task_id
assert _task_id is None
if num_processes is None or num_processes <= 0:
num_processes = cpu_count()
Returns None if this process was not created by `fork_processes`.
"""
- global _task_id
return _task_id
# License for the specific language governing permissions and limitations
# under the License.
-"""A non-blocking TCP connection factory.
-"""
+"""A non-blocking TCP connection factory."""
import functools
import socket
def _create_stream(
self,
- max_buffer_size: int,
+ max_buffer_size: Optional[int],
af: socket.AddressFamily,
addr: Tuple,
source_ip: Optional[str] = None,
-"""Shim to allow python -m tornado.test.
-"""
+"""Shim to allow python -m tornado.test."""
from tornado.test.runtests import all, main
count = [0]
class MyExecutor(futures.ThreadPoolExecutor):
- def submit(self, func, *args):
+ def submit(self, func, *args): # type: ignore[override]
count[0] += 1
return super().submit(func, *args)
import os
import re
import socket
-import typing # noqa: F401
+import typing
import unittest
import urllib.parse
settings=dict(cookie_secret=cookie_secret, key_version=key_version)
)
- def get_cookie(self, name):
- return self._cookies.get(name)
+ def get_cookie(self, name) -> typing.Optional[str]: # type: ignore[override]
+ return to_unicode(self._cookies.get(name))
- def set_cookie(self, name, value, expires_days=None):
+ def set_cookie(self, name, value, expires_days=None): # type: ignore[override]
self._cookies[name] = value
class CoroutineOnMessageHandler(TestWebSocketHandler):
- def initialize(self, **kwargs):
+ def initialize(self, **kwargs): # type: ignore[override]
super().initialize(**kwargs)
self.sleeping = 0
class SubprotocolHandler(TestWebSocketHandler):
- def initialize(self, **kwargs):
+ def initialize(self, **kwargs): # type: ignore[override]
super().initialize(**kwargs)
self.select_subprotocol_called = False
class OpenCoroutineHandler(TestWebSocketHandler):
- def initialize(self, test, **kwargs):
+ def initialize(self, test, **kwargs): # type: ignore[override]
super().initialize(**kwargs)
self.test = test
self.open_finished = False
class NativeCoroutineOnMessageHandler(TestWebSocketHandler):
- def initialize(self, **kwargs):
+ def initialize(self, **kwargs): # type: ignore[override]
super().initialize(**kwargs)
self.sleeping = 0
def raise_exc_info(
- exc_info: Tuple[Optional[type], Optional[BaseException], Optional["TracebackType"]]
+ exc_info: Tuple[Optional[type], Optional[BaseException], Optional["TracebackType"]],
) -> typing.NoReturn:
try:
if exc_info[1] is not None:
pass
class _Decompressor(Protocol):
- unconsumed_tail = b"" # type: bytes
+ @property
+ def unconsumed_tail(self) -> bytes:
+ pass
def decompress(self, data: bytes, max_length: int) -> bytes:
pass
# TODO: Add wbits option.
return None
- def open(self, *args: str, **kwargs: str) -> Optional[Awaitable[None]]:
- """Invoked when a new WebSocket is opened.
+ def _open(self, *args: str, **kwargs: str) -> Optional[Awaitable[None]]:
+ pass
- The arguments to `open` are extracted from the `tornado.web.URLSpec`
- regular expression, just like the arguments to
- `tornado.web.RequestHandler.get`.
+ open = _open # type: Callable[..., Optional[Awaitable[None]]]
+ """Invoked when a new WebSocket is opened.
- `open` may be a coroutine. `on_message` will not be called until
- `open` has returned.
+ The arguments to `open` are extracted from the `tornado.web.URLSpec`
+ regular expression, just like the arguments to
+ `tornado.web.RequestHandler.get`.
- .. versionchanged:: 5.1
+ `open` may be a coroutine. `on_message` will not be called until
+ `open` has returned.
- ``open`` may be a coroutine.
- """
- pass
+ .. versionchanged:: 5.1
+
+ ``open`` may be a coroutine.
+ """
def on_message(self, message: Union[str, bytes]) -> Optional[Awaitable[None]]:
"""Handle incoming messages on the WebSocket