Frequenz Python SDK Release Notes
Summary
This release includes a new ConfigManager
class to simplify managing the configuration, and ships other improvements and fixes to the config system in general.
Upgrading
-
frequenz.sdk.config
-
LoggingConfigUpdater
- Renamed to
LoggingConfigUpdatingActor
to follow the actor naming convention. - The actor must now be constructed using a
ConfigManager
instead of a receiver. - Make all arguments to the constructor keyword-only, except for the
config_manager
argument. - If the configuration is removed, the actor will now load back the default configuration.
- Renamed to
-
LoggingConfig
- The
load()
method was removed. Please usefrequenz.sdk.config.load_config()
instead. - The class is now a standard
dataclass
instead of amarshmallow_dataclass
. - The class is now immutable.
- The constructor now accepts only keyword arguments.
- The
-
LoggerConfig
- The class is now a standard
dataclass
instead of amarshmallow_dataclass
. - The class is now immutable.
- The constructor now accepts only keyword arguments.
- The class is now a standard
-
load_config()
:- The
base_schema
argument is now keyword-only and defaults toBaseConfigSchema
(and because of this, it usesunknown=EXCLUDE
by default). - The arguments forwarded to
marshmallow.Schema.load()
now must be passed explicitly via themarshmallow_load_kwargs
argument, as adict
, to improve the type-checking. - Will now raise a
ValueError
ifunknown
is set toINCLUDE
inmarshmallow_load_kwargs
.
- The
-
ConfigManagingActor
: Raise aValueError
if theconfig_files
argument an empty sequence.
-
New Features
-
frequenz.sdk.config
-
Logging was improved in general.
-
Added documentation and user guide.
-
LoggingConfigUpdatingActor
- Added a new
name
argument to the constructor to be able to override the actor's name.
- Added a new
-
ConfigManager
: Added a class to simplify managing the configuration. It takes care of instantiating the config actors and provides a convenient method for creating receivers with a lot of common functionality. -
BaseConfigSchema
: Added amarshmallow
baseSchema
that includes custom fields forfrequenz-quantities
. In the futute more commonly used fields might be added. -
wait_for_first()
: Added a function to make it easy to wait for the first configuration to be received with a timeout. -
ConfigManagingActor
: Allow passing a single configuration file.
-
Bug Fixes
-
Fix a bug in
BackgroundService
where it won't try toself.cancel()
andawait self.wait()
if there are no internal tasks. This prevented to properly implement custom stop logic without having to redefine thestop()
method too. -
Fix a bug where if a string was passed to the
ConfigManagingActor
it would be interpreted as a sequence of 1 character strings. -
Remove a confusing log message in the power distributing actor.
-
Close all receivers owned by a *pool when stopping the pool.
What's Changed
- Bump the required group with 4 updates by @dependabot in #1123
- Clear release notes by @llucax in #1122
- Reorganize the
config
module by @llucax in #1126 - Improve the logging config actor by @llucax in #1127
- Make
LoggerConfig
andLoggingConfig
frozen and keyword-only by @llucax in #1128 - Add load_shedding example by @Marenz in #1131
- Improve logging and API of the
config
module by @llucax in #1133 - Fix cross-arch CI tests by @llucax in #1141
- Bump types-markdown from 3.7.0.20240822 to 3.7.0.20241204 by @dependabot in #1138
- Bump types-setuptools from 75.6.0.20241126 to 75.6.0.20241223 by @dependabot in #1139
- Don't allow checking if
None
is within the bounds by @llucax in #1140 - Revamp config management by @llucax in #1134
- Bump the required group across 1 directory with 8 updates by @dependabot in #1143
- Move default
unknown=EXCLUDE
toBaseConfigSchema
by @llucax in #1149 - Remove "Checking battery" log message by @shsms in #1151
- Disable warn on overflow in config channel receivers by @llucax in #1152
- Close all *pool's receivers when stopping the pool by @shsms in #1150
Full Changelog: v1.0.0-rc1400...v1.0.0-rc1500