Skip to content

Releases: frequenz-floss/frequenz-core-python

v1.3.0

26 Sep 13:15
Immutable release. Only release title and notes can be modified.
v1.3.0
3bc144e

Choose a tag to compare

Frequenz Core Library Release Notes

Upgrading

  • If you used enum.DeprecatedMember directly anywhere, you should probably switch to using enum.deprecated_member instead, which will tag the member value with the appropriate type.

New Features

  • A new enum.deprecated_member function 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

23 Sep 12:23
Immutable release. Only release title and notes can be modified.
v1.2.0
e438ddd

Choose a tag to compare

Frequenz Core Library Release Notes

New Features

  • frequenz.core.enum now provides a @unique decorator 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.unique decorator raises a ValueError:

    >>> 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 @unique decorator that ignores deprecated enum members by @llucax in #96

Full Changelog: v1.1.0...v1.2.0

v1.1.0

26 Aug 12:04
v1.1.0
8fbba31

Choose a tag to compare

Frequenz Core Library Release Notes

New Features

  • A new frequenz.core.enum module was added, providing a drop-in replacement Enum that 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 Enum class 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

23 Jun 08:44
v1.0.2
f5576e1

Choose a tag to compare

Frequenz Core Library Release Notes

Bug Fixes

  • BaseId will 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 use warn() but that complicated the building process for all downstream projects, requiring them to add an exception for exactly this warning.

What's Changed

  • Log instead of warn when registering an ID prefix that already exists by @Marenz in #75

Full Changelog: v1.0.1...v1.0.2

v1.0.1

18 Jun 12:09
v1.0.1
130563d

Choose a tag to compare

Frequenz Core Library Release Notes

Bug Fixes

  • BaseId will 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

  • BaseId: warn() instead of raise for duplicate prefixes by @Marenz in #73

New Contributors

Full Changelog: v1.0.0...v1.0.1

v1.0.0

06 Jun 13:13
v1.0.0
bfa3ef3

Choose a tag to compare

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

New Contributors

Full Changelog: https://github.com/frequenz-floss/frequenz-core-python/commits/v1.0.0