Skip to content

Commit 5269166

Browse files
Update frequenz-client-common requirement from <0.4.0,>=0.3.8 to >=0.3.8,<0.5.0 (#309)
Updates the requirements on [frequenz-client-common](https://github.com/frequenz-floss/frequenz-client-common-python) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/frequenz-floss/frequenz-client-common-python/releases">frequenz-client-common's releases</a>.</em></p> <blockquote> <h2>v0.4.0</h2> <h1>Frequenz Client Common Library Release Notes</h1> <h2>Summary</h2> <p>This breaking release removes deprecated compatibility modules and symbols, and implicit enum conversions.</p> <h2>Upgrading</h2> <blockquote> <p>[!NOTE] We recommend upgrading first to v0.3.8 and remove all deprecation warnings (and implicit conversions of enum values to protobuf messages) before upgrading to v0.4.0.</p> <p>By doing so you'll be guided by the deprecation warnings and when you are done, upgrading to v0.4.0 should imply not extra work.</p> </blockquote> <ul> <li>Passing enum values directly to build protobuf messages is not longer supported, you need to call the conversion functions <code>xxx_(from|to)_proto_v1alpha8()</code> explicitly.</li> <li>Replace <code>frequenz.client.common.metric.Metric</code> with <code>frequenz.client.common.metrics.Metric</code>.</li> <li>Replace <code>frequenz.client.common.microgrid.components</code> imports with <code>frequenz.client.common.microgrid.electrical_components</code> imports.</li> <li>Replace <code>frequenz.client.common.enum_proto.enum_from_proto</code> with <code>frequenz.client.common.proto.enum_from_proto</code>.</li> <li>Replace <code>frequenz.client.common.metrics.proto</code> conversion imports with <code>frequenz.client.common.metrics.proto.v1alpha8</code> imports.</li> <li>Replace <code>PaginationInfo.from_proto()</code>, <code>PaginationInfo.to_proto()</code>, and <code>PaginationInfo.to_proto_v1alpha8()</code> with <code>frequenz.client.common.pagination.proto.v1alpha8</code> conversion functions.</li> <li>Replace <code>frequenz.client.common.pagination.Info</code> with <code>frequenz.client.common.pagination.PaginationInfo</code>.</li> <li>Use API-provided <code>v1alpha8</code> pagination protobuf messages directly instead of <code>frequenz.client.common.pagination.Params</code>.</li> </ul> <h2>What's Changed</h2> <ul> <li>Merge tag 'v0.3.8' into 'v0.x.x' by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-client-common-python/pull/195">frequenz-floss/frequenz-client-common-python#195</a></li> <li>Remove deprecated symbols by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-client-common-python/pull/196">frequenz-floss/frequenz-client-common-python#196</a></li> <li>Prepare release notes for release v0.4.0 by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-client-common-python/pull/199">frequenz-floss/frequenz-client-common-python#199</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/frequenz-floss/frequenz-client-common-python/compare/v0.3.8...v0.4.0">https://github.com/frequenz-floss/frequenz-client-common-python/compare/v0.3.8...v0.4.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/frequenz-floss/frequenz-client-common-python/blob/v0.x.x/RELEASE_NOTES.md">frequenz-client-common's changelog</a>.</em></p> <blockquote> <h1>Frequenz Client Common Library Release Notes</h1> <blockquote> <p>[!IMPORTANT] This release adopted <code>frequenz.core.typing.FloatInt</code>, a type alias for <code>float | int</code>, for annotations that may contain either floating-point or integer values.</p> <p>PEP 484's <a href="https://peps.python.org/pep-0484/#the-numeric-tower">numeric tower</a> makes <code>int</code> assignable wherever <code>float</code> is annotated, while at runtime <code>isinstance(1, float)</code> is <code>False</code> — so a plain <code>float</code> annotation silently admits values that crash <code>match … case float():</code> arms and <code>float</code>-only methods like <code>hex()</code>. The library now annotates <code>floats</code> with <code>FloatInt</code> instead. See <a href="https://frequenz-floss.github.io/frequenz-core-python/v1.4/reference/frequenz/core/typing/#frequenz.core.typing.FloatInt"><code>FloatInt</code> documentation</a> for details.</p> </blockquote> <h2>Summary</h2> <blockquote> <p>[!NOTE] Despite the patch version number, this is a huge release: 58 pull requests and over 320 commits, adding about 6,000 lines to the library, 9,000 lines of tests and 1,800 lines of documentation. It realizes the new library design while keeping backwards compatibility with v0.4.0; the remaining (breaking) cleanup of everything deprecated here will follow in v0.5.0.</p> </blockquote> <p>The release brings the wrappers for the Microgrid and Assets APIs (<code>Microgrid</code>, <code>Location</code>, <code>Lifetime</code>, and the whole <code>ElectricalComponent</code> class hierarchy with its connections) and settles how invalid wire data is handled: conversion functions no longer raise or report issues through side channels, they return an <code>Invalid*</code> representation instead, and safe <code>get_*()</code> accessors raise clear exceptions. Every <code>UNSPECIFIED</code> enum member, the electrical component category and type enums, and the <code>*_with_issues()</code> and single-return converters they replace are deprecated and scheduled for removal in v0.5.0.</p> <p>It also introduces 3 new guides in the documentation: a User Guide for users of the wrapper types, a Client Developer Guide for <code>frequenz-client-*</code> library authors, and a Wrapping Guide for anyone designing a wrapper.</p> <p>There are a few intentional hard breaks too, all listed in the Upgrading section: <code>MetricSample.bounds</code> became <code>bounds_set</code>, <code>MetricSample.sample_time</code> became <code>sample_time2</code>, <code>MetricConnection.name</code> is no longer optional, and some constructors that silently accepted invalid values now raise.</p> <h2>Upgrading</h2> <ul> <li> <p><code>frequenz.client.common.microgrid.components.ComponentId</code> is restored as a deprecated compatibility class. It keeps its historical import path and remains a distinct type from <code>ElectricalComponentId</code>. This restores only <code>ComponentId</code>, not the removed <code>ComponentCategory</code>, <code>ComponentStateCode</code> or <code>ComponentErrorCode</code> symbols. The v0.4.0 release remains incompatible with users of the removed import path. Removal will be coordinated with downstream migration rather than tied automatically to v0.5.0.</p> </li> <li> <p><code>frequenz.client.common.microgrid.electrical_components.ElectricalComponentId</code> now renders with the prefix <code>ECID</code> instead of <code>CID</code> (for example, <code>ECID42</code> instead of <code>CID42</code>).</p> <p>This is a display-only change.</p> <p>Anyone who adopted v0.4.0 and logs or displays an <code>ElectricalComponentId</code> will see <code>ECID42</code> where they previously saw <code>CID42</code>. No code changes are needed, only an update to any log-parsing rules or UI labels that checked for the <code>CID</code> prefix.</p> </li> <li> <p>The <code>frequenz.client.common.microgrid.electrical_components.ElectricalComponentCategory</code> enum is now deprecated and will be removed in a future release.</p> <p>Accessing any member of this enum will emit a <code>DeprecationWarning</code>. Users are encouraged to switch to the <code>ElectricalComponent</code> class hierarchy (using <code>match</code> expressions or <code>isinstance()</code>) to identify components.</p> <p>Client implementers: To convert a component class to the protobuf enum values the server expects, use the new <code>electrical_component_class_to_proto()</code> / <code>electrical_component_class_from_proto()</code> converters (see New Features).</p> <p>For example, instead of:</p> <pre lang="text"><code>def filter_by(category: ElectricalComponentCategory) -&gt; ...: ... </code></pre> <p>Use:</p> <pre lang="text"><code>def filter_by(component: ElectricalComponentTypes | type[ConvertibleElectricalComponentTypes]) -&gt; ...: category_value, sub_type_value = electrical_component_class_to_proto(component) ... </code></pre> <p>The related proto-layer converters (<code>electrical_component_category_to_proto</code>, <code>electrical_component_category_from_proto</code>) are also deprecated.</p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/cef0ee277062e652ad5880f48a19147aba792dcb"><code>cef0ee2</code></a> Prepare release notes for release v0.4.0 (<a href="https://redirect.github.com/frequenz-floss/frequenz-client-common-python/issues/199">#199</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/1553b17798f1ed76b5f71c92d6d8412c7c3c9be5"><code>1553b17</code></a> Prepare release notes for release v0.4.0</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/82574d326a82a9fb12765ed856823feb075b168c"><code>82574d3</code></a> Remove deprecated symbols (<a href="https://redirect.github.com/frequenz-floss/frequenz-client-common-python/issues/196">#196</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/3b8b45af057d8f1ce6f50a62295fd7f211efbe70"><code>3b8b45a</code></a> Update release notes</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/0772f7d0dd275c984efea482022f6a14d4632d33"><code>0772f7d</code></a> Remove metrics proto shim exports</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/5e4cb7d11773ab0094ed6db72d8b83a6caaa1d6f"><code>5e4cb7d</code></a> Remove deprecated enum proto module</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/788216c1469ffc31bb981ad00cca1bc1eadc38a2"><code>788216c</code></a> Remove deprecated pagination shims</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/b58f272b29aec0567e1c62ab4cecda5a097f6f93"><code>b58f272</code></a> Remove deprecated electrical component methods</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/0c8b1249576b3aa9e82022ced580dc90a0c35d49"><code>0c8b124</code></a> Remove deprecated component module</li> <li><a href="https://github.com/frequenz-floss/frequenz-client-common-python/commit/96a35850c596ddbaaccc9565fe14da8ed756d2da"><code>96a3585</code></a> Remove deprecated metric module</li> <li>Additional commits viewable in <a href="https://github.com/frequenz-floss/frequenz-client-common-python/compare/v0.3.8...v0.4.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
2 parents 8b65c76 + 41ad0a0 commit 5269166

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies = [
4242
"frequenz-channels >= 1.6.1, < 2.0.0",
4343
"frequenz-client-dispatch >= 0.11.3, < 2.0.0",
4444
"frequenz-client-base >= 0.11.0, < 0.12.0",
45-
"frequenz-client-common >= 0.3.8, < 0.4.0",
45+
"frequenz-client-common >= 0.3.8, < 0.5.0",
4646
"frequenz-core >= 1.0.2, < 2.0.0",
4747
"grpcio >= 1.80.0, < 2.0.0",
4848
]

0 commit comments

Comments
 (0)