-
Notifications
You must be signed in to change notification settings - Fork 5
Merge tag 'v0.3.3' into v0.x.x #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Leandro Lucarella <[email protected]>
Adds: EnterpriseId, MicrogridId, ComponentId and SensorId. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
We need to bump typing-extensions to 4.13.0 because that's the minimum supported version declaraed by `frequenz-core`. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
This needs a bump of the minimum `frequenz-api-common` to v0.6.1 as this category was added in that version. Signed-off-by: Leandro Lucarella <[email protected]>
This function can convert any `int` to any `Enum`, with optional validation or forward-compatibility. Signed-off-by: Leandro Lucarella <[email protected]>
Recommend using the new `enum_from_proto()` instead. Signed-off-by: Leandro Lucarella <[email protected]>
This is to avoid errors in tests about duplicated `BaseId` prefixes. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR merges tag v0.3.3 into v0.x.x, introducing a generic enum conversion helper, deprecating specialized .from_proto() methods, and adding microgrid ID types.
- Introduce
enum_from_protoutility with comprehensive tests. - Deprecate existing
.from_proto()on metrics and component enums. - Add
EnterpriseId,MicrogridId,ComponentId, andSensorId(with matching tests).
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_enum_proto.py | Add tests for enum_from_proto, covering valid/invalid cases. |
| src/frequenz/client/common/enum_proto.py | Implement enum_from_proto with overloads and doc examples. |
| src/frequenz/client/common/microgrid/init.py | Add EnterpriseId and MicrogridId ID classes. |
| src/frequenz/client/common/microgrid/components/init.py | Add ComponentId, update imports, deprecate old enum helpers. |
| src/frequenz/client/common/microgrid/sensors.py | Add SensorId ID class. |
| src/frequenz/client/common/metric/init.py | Deprecate old Metric.from_proto(). |
| tests/microgrid/test_ids.py | Add tests for string and repr of all new ID classes. |
| pyproject.toml | Bump dependencies, simplify pytest warning settings. |
| RELEASE_NOTES.md | Document new module, deprecations, and dependency bumps. |
Comments suppressed due to low confidence (1)
RELEASE_NOTES.md:10
- The release notes mention bumped dependencies but no longer refer to the required bump for
typing-extensions(now >=4.13.0); please update or re-add that entry to keep notes in sync withpyproject.toml.
- Some minimum dependencies have been bumped, you might need to update your minimum dependencies too:
| addopts = "-W=all -Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning '-Wdefault:Protobuf gencode version 5.27.2 is exactly one major version older than the runtime version:UserWarning' -vv" | ||
| addopts = "-vv" | ||
| filterwarnings = [ | ||
| "error", |
Copilot
AI
Jul 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simple "error" filter may not match any specific warning category; consider using explicit filters (e.g., "error::Warning") or re-enable -Werror to ensure all warnings are treated as errors as intended.
| "error", | |
| "error::Warning", |
Merge tag 'v0.3.3' into v0.x.x
frequenz.client.common.enum_protohas been added, which provides a genericenum_from_proto()function to convert protobuf enums to Python enums.frequenz.client.common.microgrid.electrical_components.ElectricalComponentCategoryvalues was improved..from_proto()are deprecated, please use the newenum_from_proto()instead.MicrogridId,EnterpriseId,ComponentId, andSensorId).