python-cqrs 0.1.0__tar.gz → 0.1.3__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 (48) hide show
  1. {python_cqrs-0.1.0/src/python_cqrs.egg-info → python_cqrs-0.1.3}/PKG-INFO +1 -1
  2. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/pyproject.toml +1 -1
  3. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/dispatcher/dispatcher.py +4 -4
  4. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/mediator.py +2 -2
  5. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/requests/request_handler.py +3 -2
  6. {python_cqrs-0.1.0 → python_cqrs-0.1.3/src/python_cqrs.egg-info}/PKG-INFO +1 -1
  7. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/LICENSE +0 -0
  8. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/README.md +0 -0
  9. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/setup.cfg +0 -0
  10. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/__init__.py +0 -0
  11. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/adapters/__init__.py +0 -0
  12. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/adapters/amqp.py +0 -0
  13. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/adapters/kafka.py +0 -0
  14. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/compressors/__init__.py +0 -0
  15. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/compressors/protocol.py +0 -0
  16. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/compressors/zlib.py +0 -0
  17. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/container/__init__.py +0 -0
  18. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/container/di.py +0 -0
  19. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/container/protocol.py +0 -0
  20. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/dispatcher/__init__.py +0 -0
  21. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/__init__.py +0 -0
  22. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/bootstrap.py +0 -0
  23. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/event.py +0 -0
  24. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/event_emitter.py +0 -0
  25. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/event_handler.py +0 -0
  26. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/events/map.py +0 -0
  27. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/message_brokers/__init__.py +0 -0
  28. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/message_brokers/amqp.py +0 -0
  29. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/message_brokers/devnull.py +0 -0
  30. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/message_brokers/kafka.py +0 -0
  31. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/message_brokers/protocol.py +0 -0
  32. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/middlewares/__init__.py +0 -0
  33. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/middlewares/base.py +0 -0
  34. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/middlewares/logging.py +0 -0
  35. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/outbox/__init__.py +0 -0
  36. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/outbox/producer.py +0 -0
  37. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/outbox/protocol.py +0 -0
  38. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/outbox/repository.py +0 -0
  39. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/outbox/sqlalchemy.py +0 -0
  40. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/requests/__init__.py +0 -0
  41. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/requests/bootstrap.py +0 -0
  42. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/requests/map.py +0 -0
  43. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/requests/request.py +0 -0
  44. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/cqrs/response.py +0 -0
  45. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/python_cqrs.egg-info/SOURCES.txt +0 -0
  46. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/python_cqrs.egg-info/dependency_links.txt +0 -0
  47. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/python_cqrs.egg-info/requires.txt +0 -0
  48. {python_cqrs-0.1.0 → python_cqrs-0.1.3}/src/python_cqrs.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-cqrs
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: Python CQRS pattern implementation
5
5
  Author-email: Vadim Kozyrevskiy <vadikko2@mail.ru>
6
6
  Maintainer-email: Vadim Kozyrevskiy <vadikko2@mail.ru>
@@ -27,7 +27,7 @@ maintainers = [{name = "Vadim Kozyrevskiy", email = "vadikko2@mail.ru"}]
27
27
  name = "python-cqrs"
28
28
  readme = "README.md"
29
29
  requires-python = ">=3.10"
30
- version = "0.1.0"
30
+ version = "0.1.3"
31
31
 
32
32
  [project.optional-dependencies]
33
33
  dev = [
@@ -17,7 +17,7 @@ from cqrs.requests import request_handler
17
17
 
18
18
  logger = logging.getLogger("cqrs")
19
19
 
20
- _Resp = typing.TypeVar("_Resp", resp.Response, None, covariant=True)
20
+ _Resp = typing.TypeVar("_Resp", resp.Response, None, contravariant=True)
21
21
 
22
22
  _RequestHandler: typing.TypeAlias = (
23
23
  request_handler.RequestHandler | request_handler.SyncRequestHandler
@@ -30,8 +30,8 @@ _EventHandler: typing.TypeAlias = (
30
30
  class RequestHandlerDoesNotExist(Exception): ...
31
31
 
32
32
 
33
- class RequestDispatchResult(pydantic.BaseModel):
34
- response: resp.Response | None = pydantic.Field(default=None)
33
+ class RequestDispatchResult(pydantic.BaseModel, typing.Generic[_Resp]):
34
+ response: _Resp = pydantic.Field(default=None)
35
35
  events: typing.List[cqrs_events.Event] = pydantic.Field(default_factory=list)
36
36
 
37
37
 
@@ -59,7 +59,7 @@ class RequestDispatcher:
59
59
  wrapped_handle = self._middleware_chain.wrap(
60
60
  functools.partial(asyncio.to_thread, handler.handle),
61
61
  )
62
- response: resp.Response | None = await wrapped_handle(request)
62
+ response = await wrapped_handle(request)
63
63
 
64
64
  return RequestDispatchResult(response=response, events=handler.events)
65
65
 
@@ -9,7 +9,7 @@ from cqrs import (
9
9
  response,
10
10
  )
11
11
 
12
- Resp: typing.TypeAlias = response.Response | None
12
+ _Resp = typing.TypeVar("_Resp", response.Response, None, contravariant=True)
13
13
 
14
14
 
15
15
  class RequestMediator:
@@ -58,7 +58,7 @@ class RequestMediator:
58
58
  middleware_chain=middleware_chain, # type: ignore
59
59
  )
60
60
 
61
- async def send(self, request: requests.Request) -> Resp:
61
+ async def send(self, request: requests.Request) -> _Resp:
62
62
  dispatch_result = await self._dispatcher.dispatch(request)
63
63
 
64
64
  if dispatch_result.events:
@@ -7,6 +7,7 @@ from cqrs.requests import request as r
7
7
 
8
8
  _Req = typing.TypeVar("_Req", bound=r.Request, contravariant=True)
9
9
  _Resp = typing.TypeVar("_Resp", response.Response, None, covariant=True)
10
+ _E = typing.TypeVar("_E", bound=event.Event, contravariant=True)
10
11
 
11
12
 
12
13
  class RequestHandler(abc.ABC, typing.Generic[_Req, _Resp]):
@@ -40,7 +41,7 @@ class RequestHandler(abc.ABC, typing.Generic[_Req, _Resp]):
40
41
 
41
42
  @property
42
43
  @abc.abstractmethod
43
- def events(self) -> list[event.Event]:
44
+ def events(self) -> typing.List[_E]:
44
45
  raise NotImplementedError
45
46
 
46
47
  @abc.abstractmethod
@@ -78,7 +79,7 @@ class SyncRequestHandler(abc.ABC, typing.Generic[_Req, _Resp]):
78
79
 
79
80
  @property
80
81
  @abc.abstractmethod
81
- def events(self) -> list[event.Event]:
82
+ def events(self) -> typing.List[_E]:
82
83
  raise NotImplementedError
83
84
 
84
85
  @abc.abstractmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-cqrs
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: Python CQRS pattern implementation
5
5
  Author-email: Vadim Kozyrevskiy <vadikko2@mail.ru>
6
6
  Maintainer-email: Vadim Kozyrevskiy <vadikko2@mail.ru>
File without changes
File without changes
File without changes