Skip to content

Commit 0ad2ac7

Browse files
authored
Update to repo-config v0.11.0 (#1111)
Update the files using the migration script with the following changes: * Group artifact-related actions so they are updated together. * Add `asyncio_default_fixture_loop_scope` `pytest` option as not specifying this is deprecated. * Disable some `pylint` checks that are already checked by `mypy`. We also bump the build dependencies, so the distribution files use names that are compatible with PEP625, which will soon be required by PyPI and fix `pylint` warnings in examples that were previously ignored as they were not checked by `pylint` due to a sybil bug.
2 parents 8dc0fd5 + 0e76944 commit 0ad2ac7

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ updates:
5757
labels:
5858
- "part:tooling"
5959
- "type:tech-debt"
60+
groups:
61+
compatible:
62+
update-types:
63+
- "minor"
64+
- "patch"
65+
artifacts:
66+
patterns:
67+
- "actions/*-artifact"

pyproject.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[build-system]
55
requires = [
6-
"setuptools == 69.0.3",
7-
"setuptools_scm[toml] == 8.0.4",
8-
"frequenz-repo-config[lib] == 0.10.0",
6+
"setuptools == 75.6.0",
7+
"setuptools_scm[toml] == 8.1.0",
8+
"frequenz-repo-config[lib] == 0.11.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -63,7 +63,7 @@ dev-mkdocs = [
6363
"mkdocs-material == 9.5.43",
6464
"mkdocstrings[python] == 0.26.2",
6565
"mkdocstrings-python == 1.12.2",
66-
"frequenz-repo-config[lib] == 0.10.0",
66+
"frequenz-repo-config[lib] == 0.11.0",
6767
]
6868
dev-mypy = [
6969
"mypy == 1.13.0",
@@ -73,15 +73,15 @@ dev-mypy = [
7373
# For checking the noxfile, docs/ script, and tests
7474
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
7575
]
76-
dev-noxfile = ["nox == 2024.10.9", "frequenz-repo-config[lib] == 0.10.0"]
76+
dev-noxfile = ["nox == 2024.10.9", "frequenz-repo-config[lib] == 0.11.0"]
7777
dev-pylint = [
7878
"pylint == 3.3.1",
7979
# For checking the noxfile, docs/ script, and tests
8080
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
8181
]
8282
dev-pytest = [
8383
"pytest == 8.3.3",
84-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
84+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
8585
"pytest-mock == 3.14.0",
8686
"pytest-asyncio == 0.24.0",
8787
"time-machine == 2.12.0",
@@ -145,6 +145,8 @@ disable = [
145145
"unsubscriptable-object",
146146
# Checked by mypy
147147
"no-member",
148+
"possibly-used-before-assignment",
149+
"no-name-in-module",
148150
# Checked by flake8
149151
"f-string-without-interpolation",
150152
"redefined-outer-name",
@@ -163,6 +165,7 @@ max-attributes = 12
163165
[tool.pytest.ini_options]
164166
testpaths = ["tests", "src"]
165167
asyncio_mode = "auto"
168+
asyncio_default_fixture_loop_scope = "function"
166169
required_plugins = ["pytest-asyncio", "pytest-mock"]
167170
markers = [
168171
"integration: integration tests (deselect with '-m \"not integration\"')",

src/frequenz/sdk/actor/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class communicates through message passing. Even when no particular message pass
7777
???+ example
7878
7979
```python
80+
import asyncio
8081
from frequenz.sdk.actor import Actor, run
8182
8283
class MyActor(Actor):
@@ -85,7 +86,7 @@ async def _run(self) -> None:
8586
print("Hello World!")
8687
await asyncio.sleep(1)
8788
88-
await run(MyActor()) # (1)!
89+
await asyncio.run(MyActor()) # (1)!
8990
```
9091
9192
1. This line will block until the actor completes its execution or is manually stopped.
@@ -187,26 +188,26 @@ class we are implementing to make sure actors are properly initialized.
187188
class EchoActor(Actor): # (1)!
188189
def __init__(
189190
self,
190-
input: Receiver[int], # (2)!
191+
receiver: Receiver[int], # (2)!
191192
output: Sender[int], # (3)!
192193
name: str | None = None, # (4)!
193194
) -> None:
194195
super().__init__(name=name) # (5)!
195-
self._input: Receiver[int] = input # (6)!
196+
self._input: Receiver[int] = receiver # (6)!
196197
self._output: Sender[int] = output # (7)!
197198
```
198199
199200
1. We define a new actor class called `EchoActor` that inherits from
200201
[`Actor`][frequenz.sdk.actor.Actor].
201202
202-
2. We accept an `input` argument that will be used to receive messages from
203+
2. We accept an `receiver` argument that will be used to receive messages from
203204
a channel.
204205
3. We accept an `output` argument that will be used to send messages to a channel.
205206
4. We accept an optional `name` argument that will be used to identify the actor in
206207
logs.
207208
5. We call [`Actor.__init__()`][frequenz.sdk.actor.Actor.__init__] to make sure the
208209
actor is properly initialized.
209-
6. We store the `input` argument in a *private* attribute to use it later.
210+
6. We store the `receiver` argument in a *private* attribute to use it later.
210211
7. We store the `output` argument in a *private* attribute to use it later.
211212
212213
### The `_run()` Method
@@ -231,12 +232,12 @@ def __init__(
231232
class EchoActor(Actor):
232233
def __init__(
233234
self,
234-
input: Receiver[int],
235+
receiver: Receiver[int],
235236
output: Sender[int],
236237
name: str | None = None,
237238
) -> None:
238239
super().__init__(name=name)
239-
self._input: Receiver[int] = input
240+
self._input: Receiver[int] = receiver
240241
self._output: Sender[int] = output
241242
242243
async def _run(self) -> None: # (1)!
@@ -245,7 +246,7 @@ async def _run(self) -> None: # (1)!
245246
```
246247
247248
1. We implement the abstract [`_run()`][_run] method.
248-
2. We receive messages from the `input` channel one by one.
249+
2. We receive messages from the `receiver` one by one.
249250
3. We send the received message to the `output` channel.
250251
251252
### Stopping

0 commit comments

Comments
 (0)