Skip to content

Commit 0f8681c

Browse files
authored
Bump the required group across 1 directory with 19 updates (#95)
2 parents c1373e2 + 42a6970 commit 0f8681c

File tree

5 files changed

+37
-29
lines changed

5 files changed

+37
-29
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
## Upgrading
88

99
* `Client.stream()` will now raise an Exception when the connection is lost.
10+
* `Client.create()` and `Client.list() now take all optional arguments as keyword-only arguments.
1011

1112
## New Features
1213

pyproject.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 68.1.0",
77
"setuptools_scm[toml] == 7.1.0",
8-
"frequenz-repo-config[lib] == 0.9.2",
8+
"frequenz-repo-config[lib] == 0.10.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -52,49 +52,49 @@ name = "Frequenz Energy-as-a-Service GmbH"
5252
5353

5454
[project.optional-dependencies]
55-
cli = ["asyncclick == 8.1.7.2", "prompt-toolkit == 3.0.47", "parsedatetime==2.6", "tzlocal==5.2"]
55+
cli = ["asyncclick == 8.1.7.2", "prompt-toolkit == 3.0.48", "parsedatetime==2.6", "tzlocal==5.2"]
5656

5757
dev-flake8 = [
58-
"flake8 == 7.1.0",
58+
"flake8 == 7.1.1",
5959
"flake8-docstrings == 1.7.0",
6060
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
61-
"pydoclint == 0.5.3",
61+
"pydoclint == 0.5.9",
6262
"pydocstyle == 6.3.0",
6363
]
64-
dev-formatting = ["black == 24.4.2", "isort == 5.13.2"]
64+
dev-formatting = ["black == 24.8.0", "isort == 5.13.2"]
6565
dev-mkdocs = [
66-
"black == 24.4.2",
67-
"Markdown==3.6",
68-
"mike == 2.1.2",
66+
"black == 24.8.0",
67+
"Markdown==3.7",
68+
"mike == 2.1.3",
6969
"mkdocs-gen-files == 0.5.0",
7070
"mkdocs-literate-nav == 0.6.1",
71-
"mkdocs-macros-plugin == 1.0.5",
72-
"mkdocs-material == 9.5.27",
73-
"mkdocstrings[python] == 0.25.1",
74-
"frequenz-repo-config[lib] == 0.9.2",
71+
"mkdocs-macros-plugin == 1.2.0",
72+
"mkdocs-material == 9.5.39",
73+
"mkdocstrings[python] == 0.26.1",
74+
"frequenz-repo-config[lib] == 0.10.0",
7575
]
7676
dev-mypy = [
77-
"mypy == 1.10.1",
78-
"types-Markdown == 3.6.0.20240316",
77+
"mypy == 1.11.2",
78+
"types-Markdown == 3.7.0.20240822",
7979
# For checking the noxfile, docs/ script, and tests
8080
"frequenz-client-dispatch[cli,dev-mkdocs,dev-noxfile,dev-pytest]",
8181
"grpc-stubs == 1.53.0.5",
82-
"types-protobuf == 5.27.0.20240626",
82+
"types-protobuf == 5.28.0.20240924",
8383
]
84-
dev-noxfile = ["nox == 2024.4.15", "frequenz-repo-config[lib] == 0.9.2"]
84+
dev-noxfile = ["nox == 2024.4.15", "frequenz-repo-config[lib] == 0.10.0"]
8585
dev-pylint = [
86-
"pylint == 3.2.5",
86+
"pylint == 3.3.1",
8787
# For checking the noxfile, docs/ script, and tests
8888
"frequenz-client-dispatch[cli,dev-mkdocs,dev-noxfile,dev-pytest]",
8989
"frequenz-api-dispatch >= 0.15.1, < 0.16",
9090
]
9191
dev-pytest = [
92-
"pytest == 8.2.2",
93-
"frequenz-repo-config[extra-lint-examples] == 0.9.2",
92+
"pytest == 8.3.3",
93+
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
9494
"pytest-mock == 3.14.0",
95-
"pytest-asyncio == 0.23.7",
96-
"async-solipsism == 0.6",
97-
"hypothesis == 6.104.2",
95+
"pytest-asyncio == 0.24.0",
96+
"async-solipsism == 0.7",
97+
"hypothesis == 6.112.2",
9898
"frequenz-client-dispatch[cli]",
9999
]
100100
dev = [

src/frequenz/client/dispatch/_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def __init__(
9393
async def list(
9494
self,
9595
microgrid_id: int,
96+
*,
9697
component_selectors: Iterator[ComponentSelector] = iter(()),
9798
start_from: datetime | None = None,
9899
start_to: datetime | None = None,
@@ -231,13 +232,14 @@ def _get_stream(
231232

232233
return broadcaster
233234

234-
async def create(
235+
async def create( # pylint: disable=too-many-positional-arguments
235236
self,
236237
microgrid_id: int,
237238
type: str, # pylint: disable=redefined-builtin
238239
start_time: datetime,
239240
duration: timedelta | None,
240241
selector: ComponentSelector,
242+
*,
241243
active: bool = True,
242244
dry_run: bool = False,
243245
payload: dict[str, Any] | None = None,
@@ -265,7 +267,6 @@ async def create(
265267
266268
Raises:
267269
ValueError: If start_time is in the past.
268-
ValueError: If the created dispatch could not be found.
269270
"""
270271
if start_time <= datetime.now(tz=start_time.tzinfo):
271272
raise ValueError("start_time must not be in the past")

tests/test_dispatch_cli.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ def mock_client(fake_client: FakeClient) -> Generator[None, None, None]:
4848
yield
4949

5050

51+
# For test functions we want to disable some pylint checks, we need many (positional)
52+
# arguments to pass fixtures, these functions are not meant to be called directly, and
53+
# having too many locals in tests is not a problem either.
54+
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-locals
55+
56+
5157
@pytest.mark.asyncio
5258
@pytest.mark.parametrize(
5359
"dispatches, microgrid_id, expected_output, expected_return_code",
@@ -142,7 +148,7 @@ def mock_client(fake_client: FakeClient) -> Generator[None, None, None]:
142148
),
143149
],
144150
)
145-
async def test_list_command( # pylint: disable=too-many-arguments
151+
async def test_list_command(
146152
runner: CliRunner,
147153
fake_client: FakeClient,
148154
dispatches: dict[int, list[Dispatch]],
@@ -305,7 +311,7 @@ async def test_list_command( # pylint: disable=too-many-arguments
305311
),
306312
],
307313
)
308-
async def test_create_command( # pylint: disable=too-many-arguments,too-many-locals
314+
async def test_create_command(
309315
runner: CliRunner,
310316
fake_client: FakeClient,
311317
args: list[str],
@@ -529,7 +535,7 @@ async def test_create_command( # pylint: disable=too-many-arguments,too-many-lo
529535
),
530536
],
531537
)
532-
async def test_update_command( # pylint: disable=too-many-arguments
538+
async def test_update_command(
533539
runner: CliRunner,
534540
fake_client: FakeClient,
535541
dispatches: list[Dispatch],
@@ -631,7 +637,7 @@ async def test_get_command(
631637
),
632638
],
633639
)
634-
async def test_delete_command( # pylint: disable=too-many-arguments
640+
async def test_delete_command(
635641
runner: CliRunner,
636642
fake_client: FakeClient,
637643
dispatches: list[Dispatch],

tests/test_dispatch_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_component_selector() -> None:
2828
[ComponentCategory.METER],
2929
[ComponentCategory.EV_CHARGER, ComponentCategory.BATTERY],
3030
):
31-
protobuf = component_selector_to_protobuf(selector) # type: ignore
31+
protobuf = component_selector_to_protobuf(selector)
3232
assert component_selector_from_protobuf(protobuf) == selector
3333

3434

0 commit comments

Comments
 (0)