Skip to content

Commit

Permalink
Remove Signal from __all__, replace aiohttp.Signal with aiosignal.Sig…
Browse files Browse the repository at this point in the history
…nal in docs (#6201)
  • Loading branch information
asvetlov committed Nov 1, 2021
1 parent 16d074d commit 3c58fc3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 52 deletions.
1 change: 1 addition & 0 deletions CHANGES/6201.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove ``Signal`` from ``__all__``, replace ``aiohttp.Signal`` with ``aiosignal.Signal`` in docs
3 changes: 1 addition & 2 deletions aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@
"AsyncResolver",
"DefaultResolver",
"ThreadedResolver",
# signals
"Signal",
# streams
"DataQueue",
"EMPTY_PAYLOAD",
"EofStream",
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"python": ("http://docs.python.org/3", None),
"multidict": ("https://multidict.readthedocs.io/en/stable/", None),
"yarl": ("https://yarl.readthedocs.io/en/stable/", None),
"aiosignal": ("https://aiosignal.readthedocs.io/en/stable/", None),
"aiohttpjinja2": ("https://aiohttp-jinja2.readthedocs.io/en/stable/", None),
"aiohttpremotes": ("https://aiohttp-remotes.readthedocs.io/en/stable/", None),
"aiohttpsession": ("https://aiohttp-session.readthedocs.io/en/stable/", None),
Expand Down
45 changes: 0 additions & 45 deletions docs/signals.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ Miscellaneous API Shared between Client And Server.
multipart
multipart_reference
streams
signals
structures
websocket_utilities
8 changes: 4 additions & 4 deletions docs/web_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ duplicated like one using :meth:`~aiohttp.web.Application.copy`.

.. attribute:: on_response_prepare

A :class:`~aiohttp.Signal` that is fired near the end
A :class:`~aiosignal.Signal` that is fired near the end
of :meth:`StreamResponse.prepare` with parameters *request* and
*response*. It can be used, for example, to add custom headers to each
response, or to modify the default headers computed by the application,
Expand All @@ -1420,7 +1420,7 @@ duplicated like one using :meth:`~aiohttp.web.Application.copy`.

.. attribute:: on_startup

A :class:`~aiohttp.Signal` that is fired on application start-up.
A :class:`~aiosignal.Signal` that is fired on application start-up.

Subscribers may use the signal to run background tasks in the event
loop along with the application's request handler just after the
Expand All @@ -1435,7 +1435,7 @@ duplicated like one using :meth:`~aiohttp.web.Application.copy`.

.. attribute:: on_shutdown

A :class:`~aiohttp.Signal` that is fired on application shutdown.
A :class:`~aiosignal.Signal` that is fired on application shutdown.

Subscribers may use the signal for gracefully closing long running
connections, e.g. websockets and data streaming.
Expand All @@ -1455,7 +1455,7 @@ duplicated like one using :meth:`~aiohttp.web.Application.copy`.

.. attribute:: on_cleanup

A :class:`~aiohttp.Signal` that is fired on application cleanup.
A :class:`~aiosignal.Signal` that is fired on application cleanup.

Subscribers may use the signal for gracefully closing
connections to database server etc.
Expand Down
24 changes: 24 additions & 0 deletions tests/test___all__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import Any


def test___all__(pytester: Any) -> None:
"""
See https://github.com/aio-libs/aiohttp/issues/6197
"""
pytester.makepyfile(
test_a="""
from aiohttp import *
"""
)
result = pytester.runpytest("-vv")
result.assert_outcomes(passed=0, errors=0)


def test_web___all__(pytester: Any) -> None:
pytester.makepyfile(
test_b="""
from aiohttp.web import *
"""
)
result = pytester.runpytest("-vv")
result.assert_outcomes(passed=0, errors=0)

0 comments on commit 3c58fc3

Please sign in to comment.