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.
Files changed (21) hide show
  1. {frequenz_core-1.0.1/src/frequenz_core.egg-info → frequenz_core-1.0.2}/PKG-INFO +1 -1
  2. frequenz_core-1.0.2/RELEASE_NOTES.md +17 -0
  3. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/id.py +6 -5
  4. {frequenz_core-1.0.1 → frequenz_core-1.0.2/src/frequenz_core.egg-info}/PKG-INFO +1 -1
  5. frequenz_core-1.0.1/RELEASE_NOTES.md +0 -17
  6. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/LICENSE +0 -0
  7. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/MANIFEST.in +0 -0
  8. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/README.md +0 -0
  9. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/pyproject.toml +0 -0
  10. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/setup.cfg +0 -0
  11. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/__init__.py +0 -0
  12. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/conftest.py +0 -0
  13. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/datetime.py +0 -0
  14. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/math.py +0 -0
  15. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/module.py +0 -0
  16. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/py.typed +0 -0
  17. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz/core/typing.py +0 -0
  18. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/SOURCES.txt +0 -0
  19. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/dependency_links.txt +0 -0
  20. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/requires.txt +0 -0
  21. {frequenz_core-1.0.1 → frequenz_core-1.0.2}/src/frequenz_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: frequenz-core
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Core utilities to complement Python's standard library
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -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
- from warnings import warn
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
- warn(
118
- f"Prefix '{str_prefix}' is already registered. "
119
- "ID prefixes must be unique.",
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: frequenz-core
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Core utilities to complement Python's standard library
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -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