Releases: frequenz-floss/frequenz-core-python
v1.3.0
Frequenz Core Library Release Notes
Upgrading
- If you used
enum.DeprecatedMemberdirectly anywhere, you should probably switch to usingenum.deprecated_memberinstead, which will tag the member value with the appropriate type.
New Features
- A new
enum.deprecated_memberfunction has been added to create deprecated enum members with proper typing.
What's Changed
- Clear release notes by @llucax in #97
- Add a
deprecated_member()function to fix typing by @llucax in #98
Full Changelog: v1.2.0...v1.3.0
v1.2.0
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
v1.1.0
Frequenz Core Library Release Notes
New Features
-
A new
frequenz.core.enummodule was added, providing a drop-in replacementEnumthat supports deprecating members.Example:
from frequenz.core.enum import Enum, DeprecatedMember class TaskStatus(Enum): OPEN = 1 IN_PROGRESS = 2 PENDING = DeprecatedMember(1, "PENDING is deprecated, use OPEN instead") DONE = DeprecatedMember(3, "DONE is deprecated, use FINISHED instead") FINISHED = 4 status1 = TaskStatus.PENDING # Warns: "PENDING is deprecated, use OPEN instead" assert status1 is TaskStatus.OPEN
What's Changed
- Bump the minor group with 3 updates by @dependabot[bot] in #78
- Bump pytest-asyncio from 0.26.0 to 1.0.0 by @dependabot[bot] in #76
- Bump the patch group with 5 updates by @dependabot[bot] in #77
- Enhance README.md for better project discoverability by @Copilot in #79
- Bump mkdocs-material from 9.6.14 to 9.6.16 in the patch group by @dependabot[bot] in #83
- Bump types-markdown from 3.8.0.20250415 to 3.8.0.20250708 by @dependabot[bot] in #84
- Bump async-solipsism from 0.7 to 0.8 by @dependabot[bot] in #85
- Bump the compatible group with 2 updates by @dependabot[bot] in #86
- Bump the minor group with 2 updates by @dependabot[bot] in #80
- Bump pytest-asyncio from 1.0.0 to 1.1.0 by @dependabot[bot] in #82
- Bump the mkdocstrings group across 1 directory with 2 updates by @dependabot[bot] in #87
- Add
Enumclass that supports deprecated members by @llucax in #88
New Contributors
- @Copilot made their first contribution in #79
Full Changelog: v1.0.2...v1.1.0
v1.0.2
Frequenz Core Library Release Notes
Bug Fixes
BaseIdwill now log instead of raising a warning when a duplicate prefix is detected. This is to fix a problem with code examples being tested using sybil and the class being imported multiple times, which caused the exception to be raised. We first tried to usewarn()but that complicated the building process for all downstream projects, requiring them to add an exception for exactly this warning.
What's Changed
Full Changelog: v1.0.1...v1.0.2
v1.0.1
Frequenz Core Library Release Notes
Bug Fixes
BaseIdwill now warn instead of raising an exception when a duplicate prefix is detected. This is to fix a problem with code examples being tested using sybil and the class being imported multiple times, which caused the exception to be raised.
What's Changed
New Contributors
Full Changelog: v1.0.0...v1.0.1
v1.0.0
Frequenz Core Library Release Notes
Summary
This is the initial release of the Frequenz Core Library, which provides a set of fundamental tools and utilities for Python.
The library currently includes:
datetime: For utilities related to dates and times.
id: For creating unique system-wide ID types.math: For utilities related to math.typing: For type annotations and type-checking utilities.
But more tools will be added in the future.
What's Changed
- Initial repository structure by @llucax in #1
- Bump actions/download-artifact from 3 to 4 by @dependabot in #5
- Bump actions/upload-artifact from 3 to 4 by @dependabot in #3
- Bump the required group with 11 updates by @dependabot in #6
- Bump actions/setup-python from 4 to 5 by @dependabot in #4
- Bump actions/cache from 3 to 4 by @dependabot in #2
- Initial version of the code by @llucax in #10
- labeler: Properly add
part:labels to tests by @llucax in #18 - Add
mathmodule withis_close_to_zero()by @llucax in #17 - Fix
asyncio's module tests by @llucax in #16 - Add a new
Intervalclass based on the SDKBoundsby @llucax in #19 - Bump brettcannon/check-for-changed-files from 1.2.0 to 1.2.1 by @dependabot in #22
- Bump docker/build-push-action from 5 to 6 by @dependabot in #21
- Bump the required group with 8 updates by @dependabot in #20
- Rename
nametounique_idforBackgroundServiceby @llucax in #26 - Improve math docs by @llucax in #24
- Move
Intervaltomathby @llucax in #25 - Add a function to get a public logger for a module by @llucax in #23
- Revamp
BackgroundServiceand rename toServiceby @llucax in #27 - Implement
ServiceBaseusing a newPersistentTaskGroupby @llucax in #30 - Bump the required group across 1 directory with 18 updates by @dependabot in #32
- Bump the required group with 8 updates by @dependabot in #36
- Bump setuptools from 68.1.0 to 75.6.0 by @dependabot in #41
- Bump the required group across 1 directory with 7 updates by @dependabot in #43
- Bump setuptools-scm[toml] from 7.1.0 to 8.1.0 by @dependabot in #42
- Apply new repo-config 0.11 templates by @llucax in #44
- Bump types-markdown from 3.7.0.20240822 to 3.7.0.20241204 by @dependabot in #46
- Bump the required group across 1 directory with 7 updates by @dependabot in #47
- Improve documentation of
disable_initdecorator by @llucax in #48 - Bump the required group with 6 updates by @dependabot in #49
- Bump black from 24.10.0 to 25.1.0 by @dependabot in #50
- Bump isort from 5.13.2 to 6.0.0 by @dependabot in #51
- Bump nox from 2024.10.9 to 2025.2.9 by @dependabot in #53
- Improve
disable_initdocs and export the metaclass by @llucax in #55 - Upgrade to repo-config 0.13.1 by @llucax in #56
- Bump pytest-asyncio from 0.25.3 to 0.26.0 by @dependabot in #60
- Bump setuptools from 75.8.0 to 78.1.0 by @dependabot in #61
- Bump the mkdocstrings group with 2 updates by @dependabot in #59
- Bump types-markdown from 3.7.0.20241204 to 3.7.0.20250322 by @dependabot in #62
- Bump pydoclint from 0.6.0 to 0.6.4 by @dependabot in #63
- Bump the patch group with 5 updates by @dependabot in #57
- Bump setuptools from 78.1.0 to 80.1.0 by @dependabot in #66
- Bump pydoclint from 0.6.4 to 0.6.6 by @dependabot in #67
- Bump the patch group with 4 updates by @dependabot in #64
- Bump the minor group across 1 directory with 8 updates by @dependabot in #68
- Bump the patch group with 6 updates by @dependabot in #69
- Bump the minor group with 3 updates by @dependabot in #70
- Add a base class for creating system-wide unique IDs by @llucax in #71
- Prepare for the 1.0 release by @llucax in #72
New Contributors
- @llucax made their first contribution in #1
- @dependabot made their first contribution in #5
Full Changelog: https://github.com/frequenz-floss/frequenz-core-python/commits/v1.0.0