Skip to content

Commit f92e1ef

Browse files
authored
Bump the required group with 8 updates (#327)
2 parents defeb7f + 8ddc919 commit f92e1ef

File tree

8 files changed

+35
-27
lines changed

8 files changed

+35
-27
lines changed

benchmarks/benchmark_broadcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def time_async_task(task: Coroutine[Any, Any, int]) -> tuple[float, Any]:
141141
return timeit.default_timer() - start, ret
142142

143143

144-
# pylint: disable=too-many-arguments
144+
# pylint: disable=too-many-arguments,too-many-positional-arguments
145145
def run_one(
146146
benchmark_method: Callable[[int, int, int], Coroutine[Any, Any, int]],
147147
num_channels: int,

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dev-flake8 = [
4040
"flake8 == 7.1.1",
4141
"flake8-docstrings == 1.7.0",
4242
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
43-
"pydoclint == 0.5.6",
43+
"pydoclint == 0.5.9",
4444
"pydocstyle == 6.3.0",
4545
]
4646
dev-formatting = ["black == 24.8.0", "isort == 5.13.2"]
@@ -54,10 +54,10 @@ dev-mkdocs = [
5454
"mkdocs-gen-files == 0.5.0",
5555
"mkdocs-include-markdown-plugin == 6.2.2",
5656
"mkdocs-literate-nav == 0.6.1",
57-
"mkdocs-macros-plugin == 1.0.5",
58-
"mkdocs-material == 9.5.34",
59-
"mkdocstrings[python] == 0.26.0",
60-
"mkdocstrings-python == 1.10.9",
57+
"mkdocs-macros-plugin == 1.2.0",
58+
"mkdocs-material == 9.5.39",
59+
"mkdocstrings[python] == 0.26.1",
60+
"mkdocstrings-python == 1.11.1",
6161
"pymdownx-superfence-filter-lines == 0.1.0",
6262
]
6363
dev-mypy = [
@@ -70,13 +70,13 @@ dev-noxfile = ["nox == 2024.4.15", "frequenz-repo-config[lib] == 0.10.0"]
7070
dev-pylint = [
7171
# For checking the noxfile, docs/ script, and tests
7272
"frequenz-channels[dev-mkdocs,dev-noxfile,dev-pytest]",
73-
"pylint == 3.2.7",
73+
"pylint == 3.3.1",
7474
]
7575
dev-pytest = [
7676
"async-solipsism == 0.7",
7777
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
78-
"hypothesis == 6.111.2",
79-
"pytest == 8.3.2",
78+
"hypothesis == 6.112.2",
79+
"pytest == 8.3.3",
8080
"pytest-asyncio == 0.24.0",
8181
"pytest-mock == 3.14.0",
8282
]

src/frequenz/channels/_anycast.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ def consume(self) -> _T:
425425
426426
Raises:
427427
ReceiverStoppedError: If the receiver stopped producing messages.
428-
ReceiverError: If there is some problem with the receiver.
429428
"""
430429
if ( # pylint: disable=protected-access
431430
self._next is _Empty and self._channel._closed

src/frequenz/channels/_merge.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ def consume(self) -> ReceiverMessageT_co:
179179
180180
Raises:
181181
ReceiverStoppedError: If the receiver stopped producing messages.
182-
ReceiverError: If there is some problem with the receiver.
183182
"""
184183
if not self._results and not self._pending:
185184
raise ReceiverStoppedError(self)

src/frequenz/channels/_receiver.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@
164164
class Receiver(ABC, Generic[ReceiverMessageT_co]):
165165
"""An endpoint to receive messages."""
166166

167-
async def __anext__(self) -> ReceiverMessageT_co:
167+
# We need the noqa here because ReceiverError can be raised by ready() and consume()
168+
# implementations.
169+
async def __anext__(self) -> ReceiverMessageT_co: # noqa: DOC503
168170
"""Await the next message in the async iteration over received messages.
169171
170172
Returns:
@@ -215,7 +217,9 @@ def __aiter__(self) -> Self:
215217
"""
216218
return self
217219

218-
async def receive(self) -> ReceiverMessageT_co:
220+
# We need the noqa here because ReceiverError can be raised by consume()
221+
# implementations.
222+
async def receive(self) -> ReceiverMessageT_co: # noqa: DOC503
219223
"""Receive a message.
220224
221225
Returns:
@@ -226,19 +230,18 @@ async def receive(self) -> ReceiverMessageT_co:
226230
ReceiverError: If there is some problem with the receiver.
227231
"""
228232
try:
229-
received = await self.__anext__() # pylint: disable=unnecessary-dunder-call
233+
received = await anext(self)
230234
except StopAsyncIteration as exc:
231235
# If we already had a cause and it was the receiver was stopped,
232236
# then reuse that error, as StopAsyncIteration is just an artifact
233237
# introduced by __anext__.
234238
if (
235239
isinstance(exc.__cause__, ReceiverStoppedError)
236-
# pylint is not smart enough to figure out we checked above
237-
# this is a ReceiverStoppedError and thus it does have
238-
# a receiver member
239-
and exc.__cause__.receiver is self # pylint: disable=no-member
240+
and exc.__cause__.receiver is self
240241
):
241-
raise exc.__cause__
242+
# This is a false positive, we are actually checking __cause__ is a
243+
# ReceiverStoppedError which is an exception.
244+
raise exc.__cause__ # pylint: disable=raising-non-exception
242245
raise ReceiverStoppedError(self) from exc
243246
return received
244247

@@ -450,7 +453,6 @@ def consume(self) -> ReceiverMessageT_co:
450453
451454
Raises:
452455
ReceiverStoppedError: If the receiver stopped producing messages.
453-
ReceiverError: If there is a problem with the receiver.
454456
"""
455457
if self._recv_closed:
456458
raise ReceiverStoppedError(self)

src/frequenz/channels/_select.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ def __init__(self, receiver: Receiver[ReceiverMessageT_co], /) -> None:
196196
self._handled: bool = False
197197
"""Flag to indicate if this selected has been handled in the if-chain."""
198198

199+
# We need the noqa here because pydoclint can't figure out raise self._exception
200+
# actually raise an Exception.
199201
@property
200-
def message(self) -> ReceiverMessageT_co:
202+
def message(self) -> ReceiverMessageT_co: # noqa: DOC503
201203
"""The message that was received, if any.
202204
203205
Returns:
@@ -339,7 +341,11 @@ def __init__(self, selected: Selected[ReceiverMessageT_co]) -> None:
339341
# https://github.com/python/mypy/issues/13597
340342

341343

342-
async def select(*receivers: Receiver[Any]) -> AsyncIterator[Selected[Any]]:
344+
# We need the noqa here because BaseExceptionGroup can be raised indirectly by
345+
# _stop_pending_tasks.
346+
async def select( # noqa: DOC503
347+
*receivers: Receiver[Any],
348+
) -> AsyncIterator[Selected[Any]]:
343349
"""Iterate over the messages of all receivers as they receive new messages.
344350
345351
This function is used to iterate over the messages of all receivers as they receive

src/frequenz/channels/event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
import asyncio as _asyncio
1818

19-
from frequenz.channels import _receiver
19+
from frequenz.channels._receiver import Receiver, ReceiverStoppedError
2020

2121

22-
class Event(_receiver.Receiver[None]):
22+
class Event(Receiver[None]):
2323
"""A receiver that can be made ready directly.
2424
2525
# Usage
@@ -161,7 +161,7 @@ def consume(self) -> None:
161161
ReceiverStoppedError: If this receiver is stopped.
162162
"""
163163
if not self._is_set and self._is_stopped:
164-
raise _receiver.ReceiverStoppedError(self)
164+
raise ReceiverStoppedError(self)
165165

166166
assert self._is_set, "calls to `consume()` must be follow a call to `ready()`"
167167

src/frequenz/channels/timer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ class Timer(Receiver[timedelta]):
466466
depending on the chosen policy.
467467
"""
468468

469-
def __init__( # pylint: disable=too-many-arguments
469+
# We need the noqa here because RuntimeError is raised indirectly.
470+
def __init__( # noqa: DOC503 pylint: disable=too-many-arguments
470471
self,
471472
interval: timedelta,
472473
missed_tick_policy: MissedTickPolicy,
@@ -586,7 +587,8 @@ def is_running(self) -> bool:
586587
"""Whether the timer is running."""
587588
return not self._stopped
588589

589-
def reset(
590+
# We need the noqa here because RuntimeError is raised indirectly.
591+
def reset( # noqa: DOC503
590592
self,
591593
*,
592594
interval: timedelta | None = None,

0 commit comments

Comments
 (0)