v1.2.0
·
19 commits
to v1.x.x
since this release
Immutable
release. Only release title and notes can be modified.
Frequenz Core Library Release Notes
New Features
-
frequenz.core.enumnow provides a@uniquedecorator that is aware of deprecations, and will only check for uniqueness among non-deprecated enum members.For example this works:
>>> from frequenz.core.enum import DeprecatedMember, Enum, unique >>> >>> @unique ... class Status(Enum): ... ACTIVE = 1 ... INACTIVE = 2 ... PENDING = DeprecatedMember(1, "PENDING is deprecated, use ACTIVE instead") ... >>>
While using the standard library's
enum.uniquedecorator raises aValueError:>>> from enum import unique >>> from frequenz.core.enum import DeprecatedMember, Enum >>> >>> @unique ... class Status(Enum): ... ACTIVE = 1 ... INACTIVE = 2 ... PENDING = DeprecatedMember(1, "PENDING is deprecated, use ACTIVE instead") ... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.12/enum.py", line 1617, in unique raise ValueError('duplicate values found in %r: %s' % ValueError: duplicate values found in <enum 'Status'>: PENDING -> ACTIVE >>>
What's Changed
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #95
- Bump types-markdown from 3.8.0.20250708 to 3.8.0.20250809 by @dependabot[bot] in #94
- Bump pydoclint from 0.6.6 to 0.6.11 by @dependabot[bot] in #91
- Bump actions/download-artifact from 4 to 5 in the artifacts group by @dependabot[bot] in #92
- Bump setuptools-scm[toml] from 8.3.1 to 9.2.0 by @dependabot[bot] in #93
- Bump mkdocstrings-python from 1.17.0 to 1.18.2 in the mkdocstrings group by @dependabot[bot] in #89
- Bump the patch group with 4 updates by @dependabot[bot] in #90
- Add
@uniquedecorator that ignores deprecated enum members by @llucax in #96
Full Changelog: v1.1.0...v1.2.0