edri 2025.12.1rc3__tar.gz → 2025.12.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 (168) hide show
  1. {edri-2025.12.1rc3 → edri-2025.12.2}/PKG-INFO +1 -1
  2. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/manager/manager_base.py +1 -1
  3. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/dataclass/api_event.py +1 -1
  4. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/base_handler.py +5 -2
  5. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/http_handler.py +13 -16
  6. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/listener.py +1 -1
  7. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/directive/http.py +2 -0
  8. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/injection.py +1 -27
  9. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/validation.py +1 -1
  10. {edri-2025.12.1rc3 → edri-2025.12.2}/edri.egg-info/PKG-INFO +1 -1
  11. {edri-2025.12.1rc3 → edri-2025.12.2}/setup.py +1 -1
  12. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_function.py +0 -16
  13. {edri-2025.12.1rc3 → edri-2025.12.2}/README.md +0 -0
  14. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/__init__.py +0 -0
  15. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/__init__.py +0 -0
  16. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/manager/__init__.py +0 -0
  17. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/manager/manager_priority_base.py +0 -0
  18. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/manager/worker.py +0 -0
  19. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/worker/__init__.py +0 -0
  20. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/worker/worker.py +0 -0
  21. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/worker/worker_process.py +0 -0
  22. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/abstract/worker/worker_thread.py +0 -0
  23. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/__init__.py +0 -0
  24. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/broker.py +0 -0
  25. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/dataclass/__init__.py +0 -0
  26. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/dataclass/client.py +0 -0
  27. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/dataclass/file.py +0 -0
  28. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/extensions/__init__.py +0 -0
  29. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/extensions/url_extension.py +0 -0
  30. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/extensions/url_prefix.py +0 -0
  31. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/__init__.py +0 -0
  32. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/html_handler.py +0 -0
  33. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/rest_handler.py +0 -0
  34. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/handlers/websocket_handler.py +0 -0
  35. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/middleware.py +0 -0
  36. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/static_pages/documentation.j2 +0 -0
  37. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/static_pages/health_check_status.j2 +0 -0
  38. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/static_pages/status_300.j2 +0 -0
  39. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/static_pages/status_400.j2 +0 -0
  40. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/api/static_pages/status_500.j2 +0 -0
  41. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/config/__init__.py +0 -0
  42. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/config/constant.py +0 -0
  43. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/config/setting.py +0 -0
  44. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/__init__.py +0 -0
  45. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/directive/__init__.py +0 -0
  46. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/directive/base.py +0 -0
  47. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/directive/html.py +0 -0
  48. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/event.py +0 -0
  49. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/health_checker.py +0 -0
  50. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/dataclass/response.py +0 -0
  51. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/__init__.py +0 -0
  52. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/__init__.py +0 -0
  53. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/client/__init__.py +0 -0
  54. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/client/documentation.py +0 -0
  55. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/client/register.py +0 -0
  56. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/client/unregister.py +0 -0
  57. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/group/__init__.py +0 -0
  58. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/group/client.py +0 -0
  59. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/group/manage.py +0 -0
  60. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/manage/__init__.py +0 -0
  61. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/manage/list_registered.py +0 -0
  62. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/manage/register.py +0 -0
  63. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/manage/unregister.py +0 -0
  64. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/api/manage/unregister_all.py +0 -0
  65. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/__init__.py +0 -0
  66. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/__init__.py +0 -0
  67. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/manager.py +0 -0
  68. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/router.py +0 -0
  69. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/scheduler.py +0 -0
  70. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/store.py +0 -0
  71. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/switch.py +0 -0
  72. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/group/test.py +0 -0
  73. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/__init__.py +0 -0
  74. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/restart.py +0 -0
  75. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/stream_close.py +0 -0
  76. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/stream_create.py +0 -0
  77. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/stream_message.py +0 -0
  78. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/manager/worker_quit.py +0 -0
  79. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/__init__.py +0 -0
  80. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/demands.py +0 -0
  81. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/health_check.py +0 -0
  82. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/last_events.py +0 -0
  83. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/send_from.py +0 -0
  84. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/subscribe.py +0 -0
  85. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/subscribe_connector.py +0 -0
  86. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/subscribed_external.py +0 -0
  87. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/subscribed_new.py +0 -0
  88. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/unsubscribe.py +0 -0
  89. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/router/unsubscribe_all.py +0 -0
  90. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/scheduler/__init__.py +0 -0
  91. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/scheduler/cancel.py +0 -0
  92. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/scheduler/set.py +0 -0
  93. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/scheduler/set_or_update.py +0 -0
  94. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/scheduler/update.py +0 -0
  95. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/store/__init__.py +0 -0
  96. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/store/delete.py +0 -0
  97. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/store/get.py +0 -0
  98. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/store/get_callback.py +0 -0
  99. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/events/edri/store/set.py +0 -0
  100. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/__init__.py +0 -0
  101. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/cache.py +0 -0
  102. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/connector/__init__.py +0 -0
  103. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/connector/connector.py +0 -0
  104. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/connector/socket.py +0 -0
  105. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/health_checker.py +0 -0
  106. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/router/router.py +0 -0
  107. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/__init__.py +0 -0
  108. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/connection.py +0 -0
  109. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/forwarder.py +0 -0
  110. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/receiver.py +0 -0
  111. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/sender.py +0 -0
  112. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/switch/switch.py +0 -0
  113. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/__init__.py +0 -0
  114. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/cache.py +0 -0
  115. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/function.py +0 -0
  116. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/json_encoder.py +0 -0
  117. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/manager/__init__.py +0 -0
  118. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/manager/scheduler.py +0 -0
  119. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/manager/store.py +0 -0
  120. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/normalized_default_dict.py +0 -0
  121. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/queue.py +0 -0
  122. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/shared_memory_pipe.py +0 -0
  123. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/storage.py +0 -0
  124. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/transformation.py +0 -0
  125. {edri-2025.12.1rc3 → edri-2025.12.2}/edri/utility/watcher.py +0 -0
  126. {edri-2025.12.1rc3 → edri-2025.12.2}/edri.egg-info/SOURCES.txt +0 -0
  127. {edri-2025.12.1rc3 → edri-2025.12.2}/edri.egg-info/dependency_links.txt +0 -0
  128. {edri-2025.12.1rc3 → edri-2025.12.2}/edri.egg-info/requires.txt +0 -0
  129. {edri-2025.12.1rc3 → edri-2025.12.2}/edri.egg-info/top_level.txt +0 -0
  130. {edri-2025.12.1rc3 → edri-2025.12.2}/setup.cfg +0 -0
  131. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/__init__.py +0 -0
  132. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/__init__.py +0 -0
  133. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/manager/__init__.py +0 -0
  134. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/manager/test_manager_base.py +0 -0
  135. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/manager/test_manager_base_priority.py +0 -0
  136. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/worker/__init__.py +0 -0
  137. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/abstract/worker/test_worker.py +0 -0
  138. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/__init__.py +0 -0
  139. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/handlers/__init__.py +0 -0
  140. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/handlers/test_base_handler.py +0 -0
  141. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/handlers/test_html_handler.py +0 -0
  142. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/handlers/test_http_handler.py +0 -0
  143. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/api/test_broker.py +0 -0
  144. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/dataclass/__init__.py +0 -0
  145. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/dataclass/event/__init__.py +0 -0
  146. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/dataclass/event/test_event.py +0 -0
  147. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/dataclass/event/test_event_init.py +0 -0
  148. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/dataclass/event/test_response.py +0 -0
  149. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/events/__init__.py +0 -0
  150. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/events/test/__init__.py +0 -0
  151. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/events/test/event_request.py +0 -0
  152. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/events/test/ping.py +0 -0
  153. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/events/test/ping2.py +0 -0
  154. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/router/__init__.py +0 -0
  155. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/router/test_cache.py +0 -0
  156. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/router/test_health_checker.py +0 -0
  157. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/router/test_router.py +0 -0
  158. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/test_edri_init.py +0 -0
  159. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/__init__.py +0 -0
  160. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/manager/__init__.py +0 -0
  161. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/manager/test_scheduler.py +0 -0
  162. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/manager/test_store.py +0 -0
  163. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_json_encoder.py +0 -0
  164. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_normalized_default_dict.py +0 -0
  165. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_shared_memory_pipe.py +0 -0
  166. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_storage.py +0 -0
  167. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_transformation.py +0 -0
  168. {edri-2025.12.1rc3 → edri-2025.12.2}/tests/utility/test_validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edri
3
- Version: 2025.12.1rc3
3
+ Version: 2025.12.2
4
4
  Summary: Event Driven Routing Infrastructure
5
5
  Author: Marek Olšan
6
6
  Author-email: marek.olsan@gmail.com
@@ -700,7 +700,7 @@ class ManagerBase(ABC, Process, metaclass=ManagerBaseMeta):
700
700
  self.logger.debug("Received event: %s", event)
701
701
  except EOFError as e:
702
702
  self.logger.error("Communication problems", exc_info=e)
703
- return
703
+ continue
704
704
  except OSError as e:
705
705
  self.logger.error("OS problems", exc_info=e)
706
706
  continue
@@ -91,7 +91,7 @@ def api(cls=None, /, *, init=True, repr=True, eq=True, order=False,
91
91
  if get_origin(item_arg) == list:
92
92
  break
93
93
  item_type = get_origin(item_args[position])
94
- if item_type != list:
94
+ if item_type != list and not isinstance(field.type, Injection):
95
95
  raise TypeError(f"{field.name} has to be type of list if used with Header")
96
96
  headers[field.name] = field.default.name
97
97
  elif isinstance(field.default, Scope):
@@ -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
- if isinstance(cls, GenericAlias):
141
- origin = get_origin(cls) # e.g. ListValidation
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
- previous_regex = None
188
- for vot in type_.classes:
189
- for base in vot.__mro__[1:]: # Skip the type itself
190
- regex_function = cls.DATA_TYPE_REGEX.get(base)
191
-
192
- if regex_function:
193
- if previous_regex is None:
194
- previous_regex = regex_function
195
- elif previous_regex != regex_function:
196
- raise TypeError("All classes in 'inject' must have the same base class when used as URL parameters.")
197
- break # Only check the first valid base class regex
198
-
199
- if vot is StringValidator:
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": str(current_exception)
219
+ "message": current_exception.__repr__()
220
220
  })
221
221
  # Move to the next exception in the chain
222
222
  current_exception = current_exception.__context__
@@ -66,10 +66,12 @@ class UnprocessableContentResponseDirective(HTTPResponseDirective):
66
66
  class BadRequestResponseDirective(HTTPResponseDirective):
67
67
  message: str | None = None
68
68
 
69
+
69
70
  @dataclass
70
71
  class NotModifiedResponseDirective(HTTPResponseDirective):
71
72
  pass
72
73
 
74
+
73
75
  @dataclass
74
76
  class ServiceUnavailableResponseDirective(HTTPResponseDirective):
75
77
  message: str | None = None
@@ -1,6 +1,5 @@
1
1
  from inspect import signature
2
- from types import GenericAlias
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 = []
@@ -248,7 +248,7 @@ class ListValidator(list):
248
248
  """
249
249
 
250
250
  def __init__(self, iterable: Iterable[Any] = (), /, *, minimum_length: int | None = None,
251
- maximum_length: int | None = None):
251
+ maximum_length: int | None = None, generics: list[Any]):
252
252
 
253
253
  super().__init__(iterable)
254
254
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edri
3
- Version: 2025.12.1rc3
3
+ Version: 2025.12.2
4
4
  Summary: Event Driven Routing Infrastructure
5
5
  Author: Marek Olšan
6
6
  Author-email: marek.olsan@gmail.com
@@ -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.01rc3',
125
+ version='2025.12.02',
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