Skip to content

Fix the examples check with pylint 4.1 - #315

Merged
llucax merged 2 commits into
frequenz-floss:v1.x.xfrom
llucax:fix-pytest-min-pylint
Oct 22, 2026
Merged

llucax merged 2 commits into
frequenz-floss:v1.x.xfrom
llucax:fix-pytest-min-pylint

Conversation

@llucax

@llucax llucax commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

The pytest_min session has been failing on v1.x.x since pylint 4.1 was released (Sep 29), which blocks every PR in the merge queue (for example #314, and #307 to #309 before it). The examples check reports not-an-iterable (E1133) for the ActorDispatcher docstring example.

Only pytest_min broke because it installs just dev-pytest, where pylint comes in unpinned through frequenz-repo-config[extra-lint-examples], while the other sessions install dev and get the pinned pylint 4.0.8.

This fixes the example itself, so it also passes with pylint 4.1, and pins pylint in dev-pytest like the repo-config template does, so every session uses the same version.

The example used `...` as a placeholder value for `other_recv` and then
iterated over it with `async for`. pylint ignores the annotation and
infers the value as `Ellipsis`, which is not iterable. pylint 4.0.8 did
not catch this, but pylint 4.1 (with astroid 4.3) reports it as
`not-an-iterable` (E1133), making the examples check fail.

Create the receiver from a `Broadcast` channel instead, which is already
imported in the example and shows how such a receiver would be created
in practice. Disabling the check would also work, but it would leave a
pylint suppression in user-facing documentation to hide an example that
is really wrong.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The examples check runs pylint, but `dev-pytest` only gets it
indirectly through `frequenz-repo-config[extra-lint-examples]`, which
accepts any `pylint >= 2.17.3, < 5`. The `pytest_min` nox session only
installs `dev-pytest`, so it always gets the latest pylint, while the
other sessions install `dev` and get the version pinned in `dev-pylint`.
This is how pylint 4.1 broke `pytest_min` while all other checks kept
passing.

Pin it to the same version as `dev-pylint`, as the repo-config template
does, so every session uses the same pylint and new releases only come
in through Dependabot.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Oct 22, 2026
@llucax
llucax requested a review from a team as a code owner October 22, 2026 10:34
@llucax llucax added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Oct 22, 2026
@llucax
llucax requested review from ela-kotulska-frequenz and removed request for a team October 22, 2026 10:34
@github-actions github-actions Bot added part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:dispatcher Affects the high-level dispatcher interface labels Oct 22, 2026
@llucax
llucax enabled auto-merge October 22, 2026 10:34
@llucax llucax added type:bug Something isn't working and removed part:dispatcher Affects the high-level dispatcher interface labels Oct 22, 2026
@llucax
llucax requested a review from Marenz October 22, 2026 10:35
@llucax
llucax added this pull request to the merge queue Oct 22, 2026
Merged via the queue into frequenz-floss:v1.x.x with commit c7a7c6c Oct 22, 2026
25 checks passed
@llucax
llucax deleted the fix-pytest-min-pylint branch October 22, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants