frequenz-client-microgrid 0.5.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/PKG-INFO +1 -1
- frequenz-client-microgrid-0.5.1/RELEASE_NOTES.md +5 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/pyproject.toml +4 -4
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_client.py +17 -1
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz_client_microgrid.egg-info/PKG-INFO +1 -1
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz_client_microgrid.egg-info/requires.txt +4 -4
- frequenz-client-microgrid-0.5.0/RELEASE_NOTES.md +0 -10
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/LICENSE +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/MANIFEST.in +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/README.md +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/setup.cfg +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/__init__.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_component.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_component_data.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_component_error.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_component_states.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_connection.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_constants.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_exception.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/_metadata.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/conftest.py +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz/client/microgrid/py.typed +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz_client_microgrid.egg-info/SOURCES.txt +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz_client_microgrid.egg-info/dependency_links.txt +0 -0
- {frequenz-client-microgrid-0.5.0 → frequenz-client-microgrid-0.5.1}/src/frequenz_client_microgrid.egg-info/top_level.txt +0 -0
|
@@ -66,9 +66,9 @@ dev-mkdocs = [
|
|
|
66
66
|
"mkdocs-gen-files == 0.5.0",
|
|
67
67
|
"mkdocs-literate-nav == 0.6.1",
|
|
68
68
|
"mkdocs-macros-plugin == 1.0.5",
|
|
69
|
-
"mkdocs-material == 9.5.
|
|
70
|
-
"mkdocstrings[python] == 0.
|
|
71
|
-
"mkdocstrings-python == 1.10.
|
|
69
|
+
"mkdocs-material == 9.5.34",
|
|
70
|
+
"mkdocstrings[python] == 0.26.0",
|
|
71
|
+
"mkdocstrings-python == 1.10.9",
|
|
72
72
|
"frequenz-repo-config[lib] == 0.10.0",
|
|
73
73
|
]
|
|
74
74
|
dev-mypy = [
|
|
@@ -79,7 +79,7 @@ dev-mypy = [
|
|
|
79
79
|
]
|
|
80
80
|
dev-noxfile = ["nox == 2024.4.15", "frequenz-repo-config[lib] == 0.10.0"]
|
|
81
81
|
dev-pylint = [
|
|
82
|
-
"pylint == 3.2.
|
|
82
|
+
"pylint == 3.2.7",
|
|
83
83
|
# For checking the noxfile, docs/ script, and tests
|
|
84
84
|
"frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]",
|
|
85
85
|
]
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import asyncio
|
|
7
7
|
import logging
|
|
8
8
|
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Set
|
|
9
|
+
from dataclasses import replace
|
|
9
10
|
from typing import Any, TypeVar, cast
|
|
10
11
|
|
|
11
12
|
import grpc.aio
|
|
@@ -44,6 +45,16 @@ _ComponentDataT = TypeVar("_ComponentDataT", bound=ComponentData)
|
|
|
44
45
|
_logger = logging.getLogger(__name__)
|
|
45
46
|
|
|
46
47
|
|
|
48
|
+
DEFAULT_CHANNEL_OPTIONS = replace(
|
|
49
|
+
channel.ChannelOptions(), ssl=channel.SslOptions(enabled=False)
|
|
50
|
+
)
|
|
51
|
+
"""The default channel options for the microgrid API client.
|
|
52
|
+
|
|
53
|
+
These are the same defaults as the common default options but with SSL disabled, as the
|
|
54
|
+
microgrid API does not use SSL by default.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
|
|
47
58
|
class ApiClient:
|
|
48
59
|
"""A microgrid API client."""
|
|
49
60
|
|
|
@@ -51,6 +62,7 @@ class ApiClient:
|
|
|
51
62
|
self,
|
|
52
63
|
server_url: str,
|
|
53
64
|
*,
|
|
65
|
+
channel_options: channel.ChannelOptions = DEFAULT_CHANNEL_OPTIONS,
|
|
54
66
|
retry_strategy: retry.Strategy | None = None,
|
|
55
67
|
) -> None:
|
|
56
68
|
"""Initialize the class instance.
|
|
@@ -62,6 +74,8 @@ class ApiClient:
|
|
|
62
74
|
where the `port` should be an int between 0 and 65535 (defaulting to
|
|
63
75
|
9090) and `ssl` should be a boolean (defaulting to `false`).
|
|
64
76
|
For example: `grpc://localhost:1090?ssl=true`.
|
|
77
|
+
channel_options: The default options use to create the channel when not
|
|
78
|
+
specified in the URL.
|
|
65
79
|
retry_strategy: The retry strategy to use to reconnect when the connection
|
|
66
80
|
to the streaming method is lost. By default a linear backoff strategy
|
|
67
81
|
is used.
|
|
@@ -69,7 +83,9 @@ class ApiClient:
|
|
|
69
83
|
self._server_url = server_url
|
|
70
84
|
"""The location of the microgrid API server as a URL."""
|
|
71
85
|
|
|
72
|
-
self.api = microgrid_pb2_grpc.MicrogridStub(
|
|
86
|
+
self.api = microgrid_pb2_grpc.MicrogridStub(
|
|
87
|
+
channel.parse_grpc_uri(server_url, defaults=channel_options)
|
|
88
|
+
)
|
|
73
89
|
"""The gRPC stub for the microgrid API."""
|
|
74
90
|
|
|
75
91
|
self._broadcasters: dict[int, streaming.GrpcStreamBroadcaster[Any, Any]] = {}
|
|
@@ -27,9 +27,9 @@ mike==2.1.3
|
|
|
27
27
|
mkdocs-gen-files==0.5.0
|
|
28
28
|
mkdocs-literate-nav==0.6.1
|
|
29
29
|
mkdocs-macros-plugin==1.0.5
|
|
30
|
-
mkdocs-material==9.5.
|
|
31
|
-
mkdocstrings[python]==0.
|
|
32
|
-
mkdocstrings-python==1.10.
|
|
30
|
+
mkdocs-material==9.5.34
|
|
31
|
+
mkdocstrings[python]==0.26.0
|
|
32
|
+
mkdocstrings-python==1.10.9
|
|
33
33
|
frequenz-repo-config[lib]==0.10.0
|
|
34
34
|
|
|
35
35
|
[dev-mypy]
|
|
@@ -42,7 +42,7 @@ nox==2024.4.15
|
|
|
42
42
|
frequenz-repo-config[lib]==0.10.0
|
|
43
43
|
|
|
44
44
|
[dev-pylint]
|
|
45
|
-
pylint==3.2.
|
|
45
|
+
pylint==3.2.7
|
|
46
46
|
frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]
|
|
47
47
|
|
|
48
48
|
[dev-pytest]
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Frequenz Microgrid API Client Release Notes
|
|
2
|
-
|
|
3
|
-
## Upgrading
|
|
4
|
-
|
|
5
|
-
- This release stops using `betterproto` and `grpclib` as backend for gRPC and goes back to using Google's `grpcio` and `protobuf`.
|
|
6
|
-
|
|
7
|
-
If your code was using `betterproto` and `grpclib`, it now needs to be ported to use `grpcio` and `protobuf` too. Remember to also remove any `betterproto` and `grpclib` dependencies from your project.
|
|
8
|
-
|
|
9
|
-
- We are now using base-client v0.6.0.
|
|
10
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|