edri 2025.12.1rc4__tar.gz → 2025.12.2rc1__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.
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/PKG-INFO +1 -1
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/base_handler.py +5 -2
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/http_handler.py +13 -16
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/listener.py +1 -1
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/injection.py +1 -27
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri.egg-info/PKG-INFO +1 -1
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/setup.py +1 -1
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_function.py +0 -16
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/README.md +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/manager/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/manager/manager_base.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/manager/manager_priority_base.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/manager/worker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/worker/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/worker/worker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/worker/worker_process.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/abstract/worker/worker_thread.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/broker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/dataclass/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/dataclass/api_event.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/dataclass/client.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/dataclass/file.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/extensions/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/extensions/url_extension.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/extensions/url_prefix.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/html_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/rest_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/handlers/websocket_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/middleware.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/static_pages/documentation.j2 +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/static_pages/health_check_status.j2 +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/static_pages/status_300.j2 +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/static_pages/status_400.j2 +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/api/static_pages/status_500.j2 +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/config/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/config/constant.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/config/setting.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/directive/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/directive/base.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/directive/html.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/directive/http.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/event.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/health_checker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/dataclass/response.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/client/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/client/documentation.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/client/register.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/client/unregister.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/group/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/group/client.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/group/manage.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/manage/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/manage/list_registered.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/manage/register.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/manage/unregister.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/api/manage/unregister_all.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/manager.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/router.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/scheduler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/store.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/switch.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/group/test.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/restart.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/stream_close.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/stream_create.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/stream_message.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/manager/worker_quit.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/demands.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/health_check.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/last_events.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/send_from.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/subscribe.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/subscribe_connector.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/subscribed_external.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/subscribed_new.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/unsubscribe.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/router/unsubscribe_all.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/scheduler/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/scheduler/cancel.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/scheduler/set.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/scheduler/set_or_update.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/scheduler/update.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/store/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/store/delete.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/store/get.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/store/get_callback.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/events/edri/store/set.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/cache.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/connector/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/connector/connector.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/connector/socket.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/health_checker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/router/router.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/connection.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/forwarder.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/receiver.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/sender.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/switch/switch.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/cache.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/function.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/json_encoder.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/manager/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/manager/scheduler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/manager/store.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/normalized_default_dict.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/queue.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/shared_memory_pipe.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/storage.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/transformation.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/validation.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri/utility/watcher.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri.egg-info/SOURCES.txt +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri.egg-info/dependency_links.txt +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri.egg-info/requires.txt +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/edri.egg-info/top_level.txt +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/setup.cfg +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/manager/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/manager/test_manager_base.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/manager/test_manager_base_priority.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/worker/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/worker/test_worker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/handlers/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/handlers/test_base_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/handlers/test_html_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/handlers/test_http_handler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/api/test_broker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/dataclass/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/dataclass/event/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/dataclass/event/test_event.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/dataclass/event/test_event_init.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/dataclass/event/test_response.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/events/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/events/test/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/events/test/event_request.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/events/test/ping.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/events/test/ping2.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/router/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/router/test_cache.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/router/test_health_checker.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/router/test_router.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/test_edri_init.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/manager/__init__.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/manager/test_scheduler.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/manager/test_store.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_json_encoder.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_normalized_default_dict.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_shared_memory_pipe.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_storage.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_transformation.py +0 -0
- {edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/utility/test_validation.py +0 -0
|
@@ -137,8 +137,8 @@ class BaseHandler[T: ResponseDirective](ABC):
|
|
|
137
137
|
# Determine underlying class and optional inner type
|
|
138
138
|
item_type = None
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
origin = get_origin(cls)
|
|
141
|
+
if origin is not None:
|
|
142
142
|
args = get_args(cls) # e.g. (int,)
|
|
143
143
|
target_cls = origin
|
|
144
144
|
|
|
@@ -159,6 +159,9 @@ class BaseHandler[T: ResponseDirective](ABC):
|
|
|
159
159
|
if k in param_names
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
if origin is not None:
|
|
163
|
+
filtered_params["generics"] = args
|
|
164
|
+
|
|
162
165
|
# If this is a list-like validator with an inner type -> convert elements first
|
|
163
166
|
if item_type is not None:
|
|
164
167
|
if (not isinstance(value, Iterable)) or isinstance(value, (str, bytes)):
|
|
@@ -184,22 +184,19 @@ class URLNode:
|
|
|
184
184
|
|
|
185
185
|
regex_function = cls.DATA_TYPE_REGEX.get(origin)
|
|
186
186
|
elif isinstance(type_, Injection):
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
regex = type_.parameters.get("regex", None)
|
|
201
|
-
if regex is not None:
|
|
202
|
-
regex_function = lambda name, _: rf"^(?P<{escape(name)}>{sub(r'^\^(.*)\$$', r'\1', regex.pattern)})$"
|
|
187
|
+
if regex := type_.parameters.get("regex"):
|
|
188
|
+
regex_function = lambda name, _: rf"^(?P<{escape(name)}>{sub(r'^\^(.*)\$$', r'\1', regex.pattern)})$"
|
|
189
|
+
else:
|
|
190
|
+
previous_regex = None
|
|
191
|
+
for vot in type_.classes:
|
|
192
|
+
for base in vot.__mro__[1:]: # Skip the type itself
|
|
193
|
+
regex_function = cls.DATA_TYPE_REGEX.get(base)
|
|
194
|
+
if regex_function:
|
|
195
|
+
if previous_regex is None:
|
|
196
|
+
previous_regex = regex_function
|
|
197
|
+
elif previous_regex != regex_function:
|
|
198
|
+
raise TypeError("All classes in 'inject' must have the same base class when used as URL parameters.")
|
|
199
|
+
break # Only check the first valid base class regex
|
|
203
200
|
|
|
204
201
|
elif issubclass(type_, Enum):
|
|
205
202
|
regex_function = cls.DATA_TYPE_REGEX.get(Enum)
|
|
@@ -216,7 +216,7 @@ class Listener(Process):
|
|
|
216
216
|
current_exception = e
|
|
217
217
|
while current_exception:
|
|
218
218
|
reasons.append({
|
|
219
|
-
"message":
|
|
219
|
+
"message": current_exception.__repr__()
|
|
220
220
|
})
|
|
221
221
|
# Move to the next exception in the chain
|
|
222
222
|
current_exception = current_exception.__context__
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from inspect import signature
|
|
2
|
-
from
|
|
3
|
-
from typing import Any, Type, get_origin
|
|
2
|
+
from typing import Any, Type
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
class Injection:
|
|
@@ -18,8 +17,6 @@ class Injection:
|
|
|
18
17
|
constructor's signature will be passed to the class.
|
|
19
18
|
|
|
20
19
|
Methods:
|
|
21
|
-
__iter__: Iterates over the provided classes and creates callables that can instantiate them
|
|
22
|
-
with the appropriate parameters.
|
|
23
20
|
__repr__: Returns a string representation of the Injection instance, showing the classes and
|
|
24
21
|
the parameters that will be passed to their constructors.
|
|
25
22
|
"""
|
|
@@ -29,29 +26,6 @@ class Injection:
|
|
|
29
26
|
self.classes = classes # Store the classes
|
|
30
27
|
self.parameters = parameters # Store the parameters
|
|
31
28
|
|
|
32
|
-
def __iter__(self):
|
|
33
|
-
# Create the callable on demand when iterating
|
|
34
|
-
for cls in self.classes:
|
|
35
|
-
# Get the signature of the __init__ method of the class
|
|
36
|
-
if isinstance(cls, GenericAlias):
|
|
37
|
-
sig = signature(get_origin(cls))
|
|
38
|
-
else:
|
|
39
|
-
sig = signature(cls)
|
|
40
|
-
# Extract parameter names from the signature
|
|
41
|
-
param_names: list[str] = [param.name for param in sig.parameters.values() if param.name != 'self']
|
|
42
|
-
|
|
43
|
-
# Filter the parameters dictionary to include only the ones needed for the class
|
|
44
|
-
filtered_params: dict[str, Any] = {k: v for k, v in self.parameters.items() if k in param_names}
|
|
45
|
-
|
|
46
|
-
# Create the callable (function) to instantiate the class with the filtered parameters
|
|
47
|
-
def create_instance(value: str, cls=cls, filtered_params=filtered_params):
|
|
48
|
-
# Here we assume that `value` will be passed to the `__init__` of the class
|
|
49
|
-
# This is a simple way to make sure that `value` can be used along with the filtered params
|
|
50
|
-
return cls(value, **filtered_params)
|
|
51
|
-
|
|
52
|
-
# Yield the callable (this will be used in the iteration)
|
|
53
|
-
yield create_instance
|
|
54
|
-
|
|
55
29
|
def __repr__(self):
|
|
56
30
|
# Representation of the class, including class names and their filtered parameters
|
|
57
31
|
param_info = []
|
|
@@ -122,7 +122,7 @@ Whether you're building a real-time data processing system, a distributed servic
|
|
|
122
122
|
|
|
123
123
|
setup(
|
|
124
124
|
name='edri',
|
|
125
|
-
version='2025.12.
|
|
125
|
+
version='2025.12.02rc1',
|
|
126
126
|
packages=find_packages(),
|
|
127
127
|
description='Event Driven Routing Infrastructure',
|
|
128
128
|
long_description=long_description,
|
|
@@ -81,22 +81,6 @@ class TestStringMethods(unittest.TestCase):
|
|
|
81
81
|
)
|
|
82
82
|
self.assertEqual(injection.classes, (StringTransformer,))
|
|
83
83
|
|
|
84
|
-
def test_iteration(self):
|
|
85
|
-
injection = Injection(
|
|
86
|
-
classes=(StringTransformer,),
|
|
87
|
-
parameters={"transform": lambda x: x[::-1]} # Reversing the string
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
# Test the callable functionality of iteration
|
|
91
|
-
iter_objects = list(injection)
|
|
92
|
-
|
|
93
|
-
# Check if the correct number of callables are yielded (should be 1 in this case)
|
|
94
|
-
self.assertEqual(len(iter_objects), 1)
|
|
95
|
-
|
|
96
|
-
# Create an instance using the yielded function and check the result
|
|
97
|
-
instance = iter_objects[0]("hello")
|
|
98
|
-
self.assertEqual(str(instance), "olleh")
|
|
99
|
-
|
|
100
84
|
def test_repr(self):
|
|
101
85
|
injection = Injection(
|
|
102
86
|
classes=(StringTransformer,),
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
{edri-2025.12.1rc4 → edri-2025.12.2rc1}/tests/abstract/manager/test_manager_base_priority.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|