Skip to content

Commit e1617f3

Browse files
authored
Update base client dependency to v0.6 (#99)
Also removes passing the channel type to the base client.
2 parents 63cd246 + e4406b7 commit e1617f3

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
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
* Update and fix readme to make use of newest release version 0.8.0
10+
* Updates the base client to version 0.6.
1011

1112
## New Features
1213

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies = [
3333
"grpcio >= 1.54.2, < 2",
3434
"grpcio-tools >= 1.54.2, < 2",
3535
"protobuf >= 4.25.3, < 6",
36-
"frequenz-client-base[grpcio] >= 0.5.0, < 0.6.0",
36+
"frequenz-client-base >= 0.6.0, < 0.7.0",
3737
]
3838
dynamic = ["version"]
3939

src/frequenz/client/reporting/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __iter__(self) -> Iterator[MetricSample]:
137137
)
138138

139139

140-
class ReportingApiClient(BaseApiClient[ReportingStub, grpcaio.Channel]):
140+
class ReportingApiClient(BaseApiClient[ReportingStub]):
141141
"""A client for the Reporting service."""
142142

143143
def __init__(self, server_url: str, key: str | None = None) -> None:
@@ -147,7 +147,7 @@ def __init__(self, server_url: str, key: str | None = None) -> None:
147147
server_url: The URL of the Reporting service.
148148
key: The API key for the authorization.
149149
"""
150-
super().__init__(server_url, ReportingStub, grpcaio.Channel)
150+
super().__init__(server_url, ReportingStub)
151151

152152
self._metadata = (("key", key),) if key else ()
153153

tests/test_client_reporting.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""Tests for the frequenz.client.reporting package."""
55
from unittest.mock import MagicMock, patch
66

7-
import grpc.aio as grpcaio
87
import pytest
98
from frequenz.api.reporting.v1.reporting_pb2_grpc import ReportingStub
109
from frequenz.client.base.client import BaseApiClient
@@ -15,12 +14,10 @@
1514

1615
@pytest.mark.asyncio
1716
async def test_client_initialization() -> None:
18-
"""Test that the client initializes the BaseApiClient with grpcaio.Channel."""
17+
"""Test that the client initializes the BaseApiClient."""
1918
with patch.object(BaseApiClient, "__init__", return_value=None) as mock_base_init:
2019
client = ReportingApiClient("gprc://localhost:50051") # noqa: F841
21-
mock_base_init.assert_called_once_with(
22-
"gprc://localhost:50051", ReportingStub, grpcaio.Channel
23-
)
20+
mock_base_init.assert_called_once_with("gprc://localhost:50051", ReportingStub)
2421

2522

2623
def test_components_data_batch_is_empty_true() -> None:

0 commit comments

Comments
 (0)