python-cq 0.7.1.post0__tar.gz → 0.7.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-cq
3
- Version: 0.7.1.post0
3
+ Version: 0.7.2
4
4
  Summary: Lightweight CQRS library.
5
5
  Project-URL: Repository, https://github.com/100nm/python-cq
6
6
  Author: remimd
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  # python-cq
29
29
 
30
30
  [![CI](https://github.com/100nm/python-cq/actions/workflows/ci.yml/badge.svg)](https://github.com/100nm/python-cq)
31
- [![PyPI - Version](https://img.shields.io/pypi/v/python-cq.svg?color=blue)](https://pypi.org/project/python-cq/)
31
+ [![PyPI - Version](https://img.shields.io/pypi/v/python-cq.svg?color=blue)](https://pypi.org/project/python-cq)
32
32
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-cq.svg?color=blue)](https://pypistats.org/packages/python-cq)
33
33
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
34
34
 
@@ -1,7 +1,7 @@
1
1
  # python-cq
2
2
 
3
3
  [![CI](https://github.com/100nm/python-cq/actions/workflows/ci.yml/badge.svg)](https://github.com/100nm/python-cq)
4
- [![PyPI - Version](https://img.shields.io/pypi/v/python-cq.svg?color=blue)](https://pypi.org/project/python-cq/)
4
+ [![PyPI - Version](https://img.shields.io/pypi/v/python-cq.svg?color=blue)](https://pypi.org/project/python-cq)
5
5
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-cq.svg?color=blue)](https://pypistats.org/packages/python-cq)
6
6
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
7
7
 
@@ -1,6 +1,6 @@
1
1
  from collections.abc import Awaitable, Callable
2
2
  from dataclasses import dataclass, field
3
- from typing import Any, Self
3
+ from typing import Any, Self, overload
4
4
 
5
5
  from cq._core.dispatcher.base import BaseDispatcher, Dispatcher
6
6
 
@@ -24,6 +24,24 @@ class Pipe[I, O](BaseDispatcher[I, O]):
24
24
  self.__dispatcher = dispatcher
25
25
  self.__steps = []
26
26
 
27
+ @overload
28
+ def step[T](
29
+ self,
30
+ wrapped: PipeConverter[T, Any],
31
+ /,
32
+ *,
33
+ dispatcher: Dispatcher[T, Any] | None = ...,
34
+ ) -> PipeConverter[T, Any]: ...
35
+
36
+ @overload
37
+ def step[T](
38
+ self,
39
+ wrapped: None = ...,
40
+ /,
41
+ *,
42
+ dispatcher: Dispatcher[T, Any] | None = ...,
43
+ ) -> Callable[[PipeConverter[T, Any]], PipeConverter[T, Any]]: ...
44
+
27
45
  def step[T](
28
46
  self,
29
47
  wrapped: PipeConverter[T, Any] | None = None,
@@ -5,7 +5,7 @@ from dataclasses import dataclass, field
5
5
  from functools import partial
6
6
  from inspect import Parameter, getmro, isclass
7
7
  from inspect import signature as inspect_signature
8
- from typing import Any, Protocol, Self, runtime_checkable
8
+ from typing import Any, Protocol, Self, overload, runtime_checkable
9
9
 
10
10
  import injection
11
11
 
@@ -89,6 +89,27 @@ class HandlerDecorator[I, O]:
89
89
  manager: HandlerManager[I, O]
90
90
  injection_module: injection.Module = field(default_factory=injection.mod)
91
91
 
92
+ @overload
93
+ def __call__(
94
+ self,
95
+ input_or_handler_type: type[I],
96
+ /,
97
+ ) -> Callable[[HandlerType[[I], O]], HandlerType[[I], O]]: ...
98
+
99
+ @overload
100
+ def __call__(
101
+ self,
102
+ input_or_handler_type: HandlerType[[I], O],
103
+ /,
104
+ ) -> HandlerType[[I], O]: ...
105
+
106
+ @overload
107
+ def __call__(
108
+ self,
109
+ input_or_handler_type: None = ...,
110
+ /,
111
+ ) -> Callable[[HandlerType[[I], O]], HandlerType[[I], O]]: ...
112
+
92
113
  def __call__(
93
114
  self,
94
115
  input_or_handler_type: type[I] | HandlerType[[I], O] | None = None,
@@ -21,7 +21,7 @@ test = [
21
21
 
22
22
  [project]
23
23
  name = "python-cq"
24
- version = "0.7.1.post0"
24
+ version = "0.7.2"
25
25
  description = "Lightweight CQRS library."
26
26
  license = "MIT"
27
27
  license-files = ["LICENSE"]
File without changes
File without changes
File without changes