python-cq 0.15.1__tar.gz → 0.15.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 (27) hide show
  1. {python_cq-0.15.1 → python_cq-0.15.2}/PKG-INFO +1 -1
  2. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/dispatcher/pipe.py +23 -18
  3. {python_cq-0.15.1 → python_cq-0.15.2}/pyproject.toml +1 -1
  4. {python_cq-0.15.1 → python_cq-0.15.2}/.gitignore +0 -0
  5. {python_cq-0.15.1 → python_cq-0.15.2}/LICENSE +0 -0
  6. {python_cq-0.15.1 → python_cq-0.15.2}/cq/__init__.py +0 -0
  7. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/__init__.py +0 -0
  8. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/common/__init__.py +0 -0
  9. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/common/typing.py +0 -0
  10. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/dispatcher/__init__.py +0 -0
  11. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/dispatcher/base.py +0 -0
  12. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/dispatcher/bus.py +0 -0
  13. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/dispatcher/lazy.py +0 -0
  14. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/handler.py +0 -0
  15. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/message.py +0 -0
  16. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/middleware.py +0 -0
  17. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/pipetools.py +0 -0
  18. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/related_events.py +0 -0
  19. {python_cq-0.15.1 → python_cq-0.15.2}/cq/_core/scope.py +0 -0
  20. {python_cq-0.15.1 → python_cq-0.15.2}/cq/exceptions.py +0 -0
  21. {python_cq-0.15.1 → python_cq-0.15.2}/cq/ext/__init__.py +0 -0
  22. {python_cq-0.15.1 → python_cq-0.15.2}/cq/ext/fastapi.py +0 -0
  23. {python_cq-0.15.1 → python_cq-0.15.2}/cq/middlewares/__init__.py +0 -0
  24. {python_cq-0.15.1 → python_cq-0.15.2}/cq/middlewares/retry.py +0 -0
  25. {python_cq-0.15.1 → python_cq-0.15.2}/cq/middlewares/scope.py +0 -0
  26. {python_cq-0.15.1 → python_cq-0.15.2}/cq/py.typed +0 -0
  27. {python_cq-0.15.1 → python_cq-0.15.2}/docs/index.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-cq
3
- Version: 0.15.1
3
+ Version: 0.15.2
4
4
  Summary: CQRS library for async Python projects.
5
5
  Project-URL: Documentation, https://python-cq.remimd.dev
6
6
  Project-URL: Repository, https://github.com/100nm/python-cq
@@ -152,25 +152,30 @@ class ContextPipeline[I]:
152
152
  if TYPE_CHECKING: # pragma: no cover
153
153
 
154
154
  @overload
155
- def __get__[O](self, instance: None, owner: type[O], /) -> Dispatcher[I, O]: ...
155
+ def __get__[Context](
156
+ self,
157
+ instance: None,
158
+ owner: type[Context],
159
+ /,
160
+ ) -> Dispatcher[I, Context]: ...
156
161
 
157
162
  @overload
158
- def __get__[O](
163
+ def __get__[Context](
159
164
  self,
160
- instance: O,
161
- owner: type[O] | None = ...,
165
+ instance: Context,
166
+ owner: type[Context] | None = ...,
162
167
  /,
163
- ) -> Dispatcher[I, O]: ...
168
+ ) -> Dispatcher[I, Context]: ...
164
169
 
165
170
  @overload
166
171
  def __get__(self, instance: None = ..., owner: None = ..., /) -> Self: ...
167
172
 
168
- def __get__[O](
173
+ def __get__[Context](
169
174
  self,
170
- instance: O | None = None,
171
- owner: type[O] | None = None,
175
+ instance: Context | None = None,
176
+ owner: type[Context] | None = None,
172
177
  /,
173
- ) -> Self | Dispatcher[I, O]:
178
+ ) -> Self | Dispatcher[I, Context]:
174
179
  if instance is None:
175
180
  if owner is None:
176
181
  return self
@@ -231,19 +236,19 @@ class ContextPipeline[I]:
231
236
 
232
237
  return decorator(wrapped) if wrapped else decorator
233
238
 
234
- async def __execute[O](
239
+ async def __execute[Context](
235
240
  self,
236
241
  input_value: I,
237
242
  /,
238
243
  *,
239
- context: O,
240
- context_type: type[O] | None,
241
- ) -> O:
242
- await self.__middleware_group.invoke(
243
- lambda i: self.__steps.execute(i, context, context_type),
244
- input_value,
245
- )
246
- return context
244
+ context: Context,
245
+ context_type: type[Context] | None,
246
+ ) -> Context:
247
+ async def handler(i: I, /) -> Context:
248
+ await self.__steps.execute(i, context, context_type)
249
+ return context
250
+
251
+ return await self.__middleware_group.invoke(handler, input_value)
247
252
 
248
253
 
249
254
  @dataclass(repr=False, eq=False, frozen=True, slots=True)
@@ -22,7 +22,7 @@ test = [
22
22
 
23
23
  [project]
24
24
  name = "python-cq"
25
- version = "0.15.1"
25
+ version = "0.15.2"
26
26
  description = "CQRS library for async Python projects."
27
27
  license = "MIT"
28
28
  license-files = ["LICENSE"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes