Skip to content

Commit 49ef8d8

Browse files
Bump the required group across 1 directory with 12 updates (#50)
Fix bugs that arose after dependency updates in #49.
2 parents 03ebc22 + 57036d9 commit 49ef8d8

File tree

4 files changed

+44
-33
lines changed

4 files changed

+44
-33
lines changed

pyproject.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,26 @@ dev-flake8 = [
4747
"flake8 == 7.1.1",
4848
"flake8-docstrings == 1.7.0",
4949
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
50-
"pydoclint == 0.5.6",
50+
"pydoclint == 0.5.8",
5151
"pydocstyle == 6.3.0",
5252
]
5353
dev-formatting = ["black == 24.8.0", "isort == 5.13.2"]
5454
dev-mkdocs = [
5555
"black == 24.8.0",
56-
"Markdown==3.6",
56+
"Markdown==3.7",
5757
"mike == 2.1.3",
5858
"mkdocs-gen-files == 0.5.0",
5959
"mkdocs-literate-nav == 0.6.1",
60-
"mkdocs-macros-plugin == 1.0.5",
61-
"mkdocs-material == 9.5.31",
62-
"mkdocstrings[python] == 0.25.2",
63-
"mkdocstrings-python == 1.10.8",
60+
"mkdocs-macros-plugin == 1.2.0",
61+
"mkdocs-material == 9.5.36",
62+
"mkdocstrings[python] == 0.26.1",
63+
"mkdocstrings-python == 1.11.1",
6464
"frequenz-repo-config[lib] == 0.10.0",
6565
]
6666
dev-mypy = [
67-
"mypy == 1.11.1",
67+
"mypy == 1.11.2",
6868
"grpc-stubs == 1.53.0.5",
69-
"types-Markdown == 3.6.0.20240316",
69+
"types-Markdown == 3.7.0.20240822",
7070
"types-protobuf == 5.27.0.20240626",
7171
# For checking the noxfile, docs/ script, and tests
7272
"frequenz-client-electricity-trading[dev-mkdocs,dev-noxfile,dev-pytest]",
@@ -76,16 +76,16 @@ dev-noxfile = [
7676
"frequenz-repo-config[lib] == 0.10.0",
7777
]
7878
dev-pylint = [
79-
"pylint == 3.2.6",
79+
"pylint == 3.3.0",
8080
# For checking the noxfile, docs/ script, and tests
8181
"frequenz-client-electricity-trading[dev-mkdocs,dev-noxfile,dev-pytest]",
8282
]
8383
dev-pytest = [
84-
"pytest == 8.3.2",
84+
"pytest == 8.3.3",
8585
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
8686
"pytest-mock == 3.14.0",
87-
"pytest-asyncio == 0.23.8",
88-
"async-solipsism == 0.6",
87+
"pytest-asyncio == 0.24.0",
88+
"async-solipsism == 0.7",
8989
"deepdiff == 8.0.1",
9090
]
9191
dev = [

src/frequenz/client/electricity_trading/_client.py

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def __init__(
118118

119119
self._metadata = (("key", auth_key),) if auth_key else ()
120120

121-
async def stream_gridpool_orders( # pylint: disable=too-many-arguments
121+
async def stream_gridpool_orders(
122+
# pylint: disable=too-many-arguments, too-many-positional-arguments
122123
self,
123124
gridpool_id: int,
124125
order_states: list[OrderState] | None = None,
@@ -173,10 +174,11 @@ async def stream_gridpool_orders( # pylint: disable=too-many-arguments
173174
_logger.exception(
174175
"Error occurred while streaming gridpool orders: %s", e
175176
)
176-
raise e
177+
raise
177178
return self._gridpool_orders_streams[stream_key].new_receiver()
178179

179-
async def stream_gridpool_trades( # pylint: disable=too-many-arguments
180+
async def stream_gridpool_trades(
181+
# pylint: disable=too-many-arguments, too-many-positional-arguments
180182
self,
181183
gridpool_id: int,
182184
trade_states: list[TradeState] | None = None,
@@ -231,7 +233,7 @@ async def stream_gridpool_trades( # pylint: disable=too-many-arguments
231233
_logger.exception(
232234
"Error occurred while streaming gridpool trades: %s", e
233235
)
234-
raise e
236+
raise
235237
return self._gridpool_trades_streams[stream_key].new_receiver()
236238

237239
async def stream_public_trades(
@@ -281,10 +283,11 @@ async def stream_public_trades(
281283
)
282284
except grpc.RpcError as e:
283285
_logger.exception("Error occurred while streaming public trades: %s", e)
284-
raise e
286+
raise
285287
return self._public_trades_streams[public_trade_filter].new_receiver()
286288

287-
def validate_params( # pylint: disable=too-many-arguments
289+
def validate_params(
290+
# pylint: disable=too-many-arguments, too-many-positional-arguments
288291
self,
289292
price: Price | None | _Sentinel = NO_VALUE,
290293
quantity: Energy | None | _Sentinel = NO_VALUE,
@@ -316,6 +319,7 @@ def validate_params( # pylint: disable=too-many-arguments
316319
317320
Raises:
318321
ValueError: If the parameters are invalid.
322+
NotImplementedError: If the order type is not supported.
319323
"""
320324
if not isinstance(price, _Sentinel) and price is not None:
321325
validate_decimal_places(price.amount, PRECISION_DECIMAL_PRICE, "price")
@@ -359,7 +363,8 @@ def validate_params( # pylint: disable=too-many-arguments
359363
"Currently only limit orders are supported"
360364
)
361365

362-
async def create_gridpool_order( # pylint: disable=too-many-arguments, too-many-locals
366+
async def create_gridpool_order(
367+
# pylint: disable=too-many-arguments, too-many-positional-arguments, too-many-locals
363368
self,
364369
gridpool_id: int,
365370
delivery_area: DeliveryArea,
@@ -441,11 +446,12 @@ async def create_gridpool_order( # pylint: disable=too-many-arguments, too-many
441446
)
442447
except grpc.RpcError as e:
443448
_logger.exception("Error occurred while creating gridpool order: %s", e)
444-
raise e
449+
raise
445450

446451
return OrderDetail.from_pb(response.order_detail)
447452

448-
async def update_gridpool_order( # pylint: disable=too-many-arguments, too-many-locals
453+
async def update_gridpool_order(
454+
# pylint: disable=too-many-arguments, too-many-positional-arguments, too-many-locals
449455
self,
450456
gridpool_id: int,
451457
order_id: int,
@@ -486,6 +492,7 @@ async def update_gridpool_order( # pylint: disable=too-many-arguments, too-many
486492
487493
Raises:
488494
ValueError: If no fields to update are provided.
495+
grpc.RpcError: An error occurred while updating the order.
489496
"""
490497
self.validate_params(
491498
price=price,
@@ -555,7 +562,7 @@ async def update_gridpool_order( # pylint: disable=too-many-arguments, too-many
555562

556563
except grpc.RpcError as e:
557564
_logger.exception("Error occurred while updating gridpool order: %s", e)
558-
raise e
565+
raise
559566

560567
async def cancel_gridpool_order(
561568
self, gridpool_id: int, order_id: int
@@ -586,7 +593,7 @@ async def cancel_gridpool_order(
586593
return OrderDetail.from_pb(response.order_detail)
587594
except grpc.RpcError as e:
588595
_logger.exception("Error occurred while cancelling gridpool order: %s", e)
589-
raise e
596+
raise
590597

591598
async def cancel_all_gridpool_orders(self, gridpool_id: int) -> int:
592599
"""
@@ -617,7 +624,7 @@ async def cancel_all_gridpool_orders(self, gridpool_id: int) -> int:
617624
_logger.exception(
618625
"Error occurred while cancelling all gridpool orders: %s", e
619626
)
620-
raise e
627+
raise
621628

622629
async def get_gridpool_order(self, gridpool_id: int, order_id: int) -> OrderDetail:
623630
"""
@@ -647,9 +654,10 @@ async def get_gridpool_order(self, gridpool_id: int, order_id: int) -> OrderDeta
647654
return OrderDetail.from_pb(response.order_detail)
648655
except grpc.RpcError as e:
649656
_logger.exception("Error occurred while getting gridpool order: %s", e)
650-
raise e
657+
raise
651658

652-
async def list_gridpool_orders( # pylint: disable=too-many-arguments
659+
async def list_gridpool_orders(
660+
# pylint: disable=too-many-arguments, too-many-positional-arguments
653661
self,
654662
gridpool_id: int,
655663
order_states: list[OrderState] | None = None,
@@ -718,9 +726,10 @@ async def list_gridpool_orders( # pylint: disable=too-many-arguments
718726
return orders
719727
except grpc.RpcError as e:
720728
_logger.exception("Error occurred while listing gridpool orders: %s", e)
721-
raise e
729+
raise
722730

723-
async def list_gridpool_trades( # pylint: disable=too-many-arguments
731+
async def list_gridpool_trades(
732+
# pylint: disable=too-many-arguments, too-many-positional-arguments
724733
self,
725734
gridpool_id: int,
726735
trade_states: list[TradeState] | None = None,
@@ -779,9 +788,10 @@ async def list_gridpool_trades( # pylint: disable=too-many-arguments
779788
return [Trade.from_pb(trade) for trade in response.trades]
780789
except grpc.RpcError as e:
781790
_logger.exception("Error occurred while listing gridpool trades: %s", e)
782-
raise e
791+
raise
783792

784-
async def list_public_trades( # pylint: disable=too-many-arguments
793+
async def list_public_trades(
794+
# pylint: disable=too-many-arguments, too-many-positional-arguments
785795
self,
786796
states: list[TradeState] | None = None,
787797
delivery_period: DeliveryPeriod | None = None,
@@ -837,4 +847,4 @@ async def list_public_trades( # pylint: disable=too-many-arguments
837847
]
838848
except grpc.RpcError as e:
839849
_logger.exception("Error occurred while listing public trades: %s", e)
840-
raise e
850+
raise

src/frequenz/client/electricity_trading/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def __init__(
321321
322322
Raises:
323323
ValueError: If the start timestamp does not have a timezone.
324-
ValueError: If the duration is not 5, 15, 30, or 60 minutes.
324+
or if the duration is not 5, 15, 30, or 60 minutes.
325325
"""
326326
if start.tzinfo is None:
327327
raise ValueError("Start timestamp must have a timezone.")

tests/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ def test_list_gridpool_orders(
373373
),
374374
],
375375
)
376-
def test_create_gridpool_order_with_invalid_params( # pylint: disable=too-many-arguments
376+
def test_create_gridpool_order_with_invalid_params(
377+
# pylint: disable=too-many-arguments, too-many-positional-arguments
377378
set_up: dict[str, Any],
378379
price: Price,
379380
quantity: Energy,

0 commit comments

Comments
 (0)