Skip to content

Commit

Permalink
Documentation: Added missing version changes (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-clairicia authored Sep 21, 2024
1 parent 6e0273f commit ef6e746
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/source/_extensions/sphinx_easynetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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,
}
2 changes: 2 additions & 0 deletions docs/source/api/lowlevel/async/transports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ Miscellaneous

.. automodule:: easynetwork.lowlevel.api_async.transports.utils
:members:

.. autoprotocol:: _TransportLike
2 changes: 2 additions & 0 deletions src/easynetwork/lowlevel/api_async/backend/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
8 changes: 8 additions & 0 deletions src/easynetwork/lowlevel/api_async/transports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,31 @@
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


class _TransportLike(Protocol):

@abstractmethod
@_utils.inherit_doc(AsyncBaseTransport)
def aclose(self) -> Awaitable[None]: ...

@abstractmethod
@_utils.inherit_doc(AsyncBaseTransport)
def backend(self) -> AsyncBackend: ...


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.
"""
Expand Down

0 comments on commit ef6e746

Please sign in to comment.