frequenz-core 1.0.1__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {frequenz_core-1.0.1/src/frequenz_core.egg-info → frequenz_core-1.0.2}/PKG-INFO +1 -1
- frequenz_core-1.0.2/RELEASE_NOTES.md +17 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/id.py +6 -5
- {frequenz_core-1.0.1 → frequenz_core-1.0.2/src/frequenz_core.egg-info}/PKG-INFO +1 -1
- frequenz_core-1.0.1/RELEASE_NOTES.md +0 -17
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/LICENSE +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/MANIFEST.in +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/README.md +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/pyproject.toml +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/setup.cfg +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/__init__.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/conftest.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/datetime.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/math.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/module.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/py.typed +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/typing.py +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/SOURCES.txt +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/dependency_links.txt +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/requires.txt +0 -0
- {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Frequenz Core Library Release Notes
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
<!-- Here goes a general summary of what this release is about -->
|
|
6
|
+
|
|
7
|
+
## Upgrading
|
|
8
|
+
|
|
9
|
+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
|
|
10
|
+
|
|
11
|
+
## New Features
|
|
12
|
+
|
|
13
|
+
<!-- Here goes the main new features and examples or instructions on how to use them -->
|
|
14
|
+
|
|
15
|
+
## Bug Fixes
|
|
16
|
+
|
|
17
|
+
* `BaseId` will now log instead of raising a warning when a duplicate prefix is detected. This is to fix [a problem with code examples](https://github.com/frequenz-floss/frequenz-repo-config-python/issues/421) 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.
|
|
@@ -62,8 +62,10 @@ Example: Creating an ID type with a non-standard name
|
|
|
62
62
|
'''
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
import logging
|
|
65
66
|
from typing import Any, ClassVar, Self, cast
|
|
66
|
-
|
|
67
|
+
|
|
68
|
+
_logger = logging.getLogger(__name__)
|
|
67
69
|
|
|
68
70
|
|
|
69
71
|
class BaseId:
|
|
@@ -114,10 +116,9 @@ class BaseId:
|
|
|
114
116
|
if str_prefix in BaseId._registered_prefixes:
|
|
115
117
|
# We want to raise an exception here, but currently can't due to
|
|
116
118
|
# https://github.com/frequenz-floss/frequenz-repo-config-python/issues/421
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
stacklevel=2,
|
|
119
|
+
_logger.warning(
|
|
120
|
+
"Prefix '%s' is already registered. ID prefixes must be unique.",
|
|
121
|
+
str_prefix,
|
|
121
122
|
)
|
|
122
123
|
BaseId._registered_prefixes.add(str_prefix)
|
|
123
124
|
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Frequenz Core Library Release Notes
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
<!-- Here goes a general summary of what this release is about -->
|
|
6
|
-
|
|
7
|
-
## Upgrading
|
|
8
|
-
|
|
9
|
-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
|
|
10
|
-
|
|
11
|
-
## New Features
|
|
12
|
-
|
|
13
|
-
<!-- Here goes the main new features and examples or instructions on how to use them -->
|
|
14
|
-
|
|
15
|
-
## Bug Fixes
|
|
16
|
-
|
|
17
|
-
* `BaseId` will now warn instead of raising an exception when a duplicate prefix is detected. This is to fix [a problem with code examples](https://github.com/frequenz-floss/frequenz-repo-config-python/issues/421) being tested using sybil and the class being imported multiple times, which caused the exception to be raised.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|