python-cq 0.7.1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 remimd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-cq
3
- Version: 0.7.1
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
7
- License: MIT
7
+ License-Expression: MIT
8
+ License-File: LICENSE
8
9
  Keywords: cqrs
9
10
  Classifier: Development Status :: 4 - Beta
10
11
  Classifier: Intended Audience :: Developers
@@ -13,6 +14,8 @@ Classifier: Operating System :: OS Independent
13
14
  Classifier: Programming Language :: Python
14
15
  Classifier: Programming Language :: Python :: 3
15
16
  Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
16
19
  Classifier: Topic :: Software Development :: Libraries
17
20
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
18
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -25,7 +28,8 @@ Description-Content-Type: text/markdown
25
28
  # python-cq
26
29
 
27
30
  [![CI](https://github.com/100nm/python-cq/actions/workflows/ci.yml/badge.svg)](https://github.com/100nm/python-cq)
28
- [![PyPI](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
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-cq.svg?color=blue)](https://pypistats.org/packages/python-cq)
29
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)
30
34
 
31
35
  Lightweight library for separating Python code according to **Command and Query Responsibility Segregation** principles.
@@ -1,7 +1,8 @@
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](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
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-cq.svg?color=blue)](https://pypistats.org/packages/python-cq)
5
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)
6
7
 
7
8
  Lightweight library for separating Python code according to **Command and Query Responsibility Segregation** principles.
@@ -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,9 +21,10 @@ test = [
21
21
 
22
22
  [project]
23
23
  name = "python-cq"
24
- version = "0.7.1"
24
+ version = "0.7.2"
25
25
  description = "Lightweight CQRS library."
26
- license = { text = "MIT" }
26
+ license = "MIT"
27
+ license-files = ["LICENSE"]
27
28
  readme = "README.md"
28
29
  requires-python = ">=3.12, <4"
29
30
  authors = [{ name = "remimd" }]
@@ -36,6 +37,8 @@ classifiers = [
36
37
  "Programming Language :: Python",
37
38
  "Programming Language :: Python :: 3",
38
39
  "Programming Language :: Python :: 3 :: Only",
40
+ "Programming Language :: Python :: 3.12",
41
+ "Programming Language :: Python :: 3.13",
39
42
  "Operating System :: OS Independent",
40
43
  "Intended Audience :: Developers",
41
44
  "Natural Language :: English",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes