diff --git a/docs/source/_extensions/sphinx_easynetwork.py b/docs/source/_extensions/sphinx_easynetwork.py index 2388514f..d790a963 100644 --- a/docs/source/_extensions/sphinx_easynetwork.py +++ b/docs/source/_extensions/sphinx_easynetwork.py @@ -5,7 +5,8 @@ v0.1.1: Fix base is not replaced if the class is generic. v0.2.0: Log when an object does not have a docstring. v0.2.1: Add base class to replace. -v0.3.0 (current): Add a "See Also" section at the end of one-shot serializers docstrings. +v0.3.0: Add a "See Also" section at the end of one-shot serializers docstrings. +v0.3.1 (current): Do not log "Undocumented protocol". """ from __future__ import annotations @@ -54,7 +55,7 @@ def _is_magic_method(name: str) -> bool: def autodoc_process_docstring(app: Sphinx, what: str, name: str, obj: Any, options: dict[str, Any], lines: list[str]) -> None: - if not lines and name.startswith("easynetwork.") and not _is_magic_method(name) and what not in {"typevar"}: + if not lines and name.startswith("easynetwork.") and not _is_magic_method(name) and what not in {"typevar", "protocol"}: logger.warning(f"Undocumented {what}: {name}") match what: @@ -71,7 +72,7 @@ def setup(app: Sphinx) -> dict[str, Any]: app.connect("autodoc-process-docstring", autodoc_process_docstring) return { - "version": "0.3.0", + "version": "0.3.1", "parallel_read_safe": True, "parallel_write_safe": True, } diff --git a/docs/source/api/lowlevel/async/transports.rst b/docs/source/api/lowlevel/async/transports.rst index 4253c473..2e415997 100644 --- a/docs/source/api/lowlevel/async/transports.rst +++ b/docs/source/api/lowlevel/async/transports.rst @@ -28,3 +28,5 @@ Miscellaneous .. automodule:: easynetwork.lowlevel.api_async.transports.utils :members: + +.. autoprotocol:: _TransportLike diff --git a/src/easynetwork/lowlevel/api_async/backend/abc.py b/src/easynetwork/lowlevel/api_async/backend/abc.py index b25cb471..f4f6ff7d 100644 --- a/src/easynetwork/lowlevel/api_async/backend/abc.py +++ b/src/easynetwork/lowlevel/api_async/backend/abc.py @@ -1151,6 +1151,8 @@ def create_fair_lock(self) -> ILock: This means that it always goes to the task which has been waiting longest. + .. versionadded:: 1.1 + Returns: A new fair Lock. """ diff --git a/src/easynetwork/lowlevel/api_async/transports/utils.py b/src/easynetwork/lowlevel/api_async/transports/utils.py index 4e5a7df1..653414f7 100644 --- a/src/easynetwork/lowlevel/api_async/transports/utils.py +++ b/src/easynetwork/lowlevel/api_async/transports/utils.py @@ -22,6 +22,9 @@ from collections.abc import Awaitable from typing import TYPE_CHECKING, Protocol +from ... import _utils +from .abc import AsyncBaseTransport + if TYPE_CHECKING: from ..backend.abc import AsyncBackend @@ -29,9 +32,11 @@ class _TransportLike(Protocol): @abstractmethod + @_utils.inherit_doc(AsyncBaseTransport) def aclose(self) -> Awaitable[None]: ... @abstractmethod + @_utils.inherit_doc(AsyncBaseTransport) def backend(self) -> AsyncBackend: ... @@ -39,6 +44,9 @@ async def aclose_forcefully(transport: _TransportLike) -> None: """ Close an async transport immediately, without blocking to do any graceful cleanup. + .. versionchanged:: 1.1 + `transport` can now be any closeable object with a ``backend()`` method. + Parameters: transport: the transport to close. """