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 authored Nov 1, 2021
1 parent 3cea180 commit 7f0cd0d
Show file tree
Hide file tree
Showing 7 changed files with 30 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
2 changes: 0 additions & 2 deletions aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@
"AsyncResolver",
"DefaultResolver",
"ThreadedResolver",
# signals
"Signal",
# streams
"DataQueue",
"EMPTY_PAYLOAD",
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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 @@ -14,6 +14,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 @@ -1372,7 +1372,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 @@ -1385,7 +1385,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 @@ -1400,7 +1400,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 @@ -1420,7 +1420,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 7f0cd0d

Please sign in to comment.