Skip to content

v1.6.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Oct 11:33
· 10 commits to v1.x.x since this release
Immutable release. Only release title and notes can be modified.
v1.6.0
11a5eed

Frequenz Core Library Release Notes

Summary

This release introduces a better way to deprecate enum members.

Upgrading

Even when this is a minor release, it ships with 2 potential breaking changes for users of DeprecatedAlias and DeprecatedMember:

  • The standard warning of a DeprecatedAlias with since no longer includes the version: it is now <old> is deprecated. Use <new> instead. since is only used for the documentation now, following the Frequenz deprecation guide. Update tests matching the old wording.
  • DeprecatedMember.message is now str | None, since a member declared with only new_name has its warning generated when the enum class is created. DeprecatedMember is not meant to be used directly, deprecated_member() is.

New Features

  • DeprecatedAlias now accepts since and message together, or neither: since is only for the documentation, and message only replaces the warning. This lets an alias with a custom warning still say since which version it is deprecated in its documentation.

  • deprecated_member() takes the replacement and version as structured, keyword-only arguments, like DeprecatedAlias: new_name, the member to use instead in the same enum, and since, the version it is deprecated since, for the documentation only. With new_name the message can be omitted, and the warning is generated with fully qualified names:

    class TaskStatus(Enum):
        OPEN = 1
        # Warns "mypkg.TaskStatus.PENDING is deprecated. Use mypkg.TaskStatus.OPEN instead."
        PENDING = deprecated_member(1, new_name="OPEN", since="v1.2.0")

    The enum class checks that new_name is one of its members and is not deprecated itself. Existing calls passing a message keep working unchanged.

    griffe-frequenz-core will read since and new_name to generate the documentation notice of these members.

Bug Fixes

  • Docstrings now use absolute cross-references to public paths instead of relative ones. Relative cross-references are expanded from the module where an object is defined since mkdocstrings-python 2.0.9, which broke some links, and projects rendering docstrings inherited from this library needed relative_crossrefs: true for them to work at all. See frequenz-repo-config-python#655 for details.

What's Changed

  • Clear release notes by @llucax in #205
  • Use absolute cross-references in docstrings by @llucax in #207
  • Bump the patch group across 1 directory with 4 updates by @dependabot[bot] in #208
  • Bump async-solipsism from 0.9 to 0.10 by @dependabot[bot] in #211
  • Bump pydoclint from 0.10.0 to 0.11.1 by @dependabot[bot] in #210
  • Bump types-markdown from 3.10.2.20260712 to 3.10.2.20261007 by @dependabot[bot] in #212
  • Bump isort from 9.0.1 to 9.0.2 by @dependabot[bot] in #213
  • Bump the minor group across 1 directory with 6 updates by @dependabot[bot] in #209
  • Separate deprecation warnings from documentation notices by @llucax in #214
  • Show the hand-written notice in the Enum example by @llucax in #215

Full Changelog: v1.5.0...v1.6.0