explicit-python 2.2.1__tar.gz → 2.3.1__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.
- {explicit_python-2.2.1/src/explicit_python.egg-info → explicit_python-2.3.1}/PKG-INFO +10 -2
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/commands.py +10 -5
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/dependency_injection.py +12 -0
- explicit_python-2.3.1/src/explicit/messagebus/exceptions.py +8 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1/src/explicit_python.egg-info}/PKG-INFO +10 -2
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit_python.egg-info/SOURCES.txt +1 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/version.conf +5 -5
- {explicit_python-2.2.1 → explicit_python-2.3.1}/MANIFEST.in +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/README.md +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/setup.cfg +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/setup.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/adapters/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/adapters/db.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/adapters/fs.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/adapters/messaging.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/domain/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/domain/model/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/domain/model/fields.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/messagebus/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/messagebus/event_registry.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/factories.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/fields.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/model.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/types.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/validation/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/validation/exceptions.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/__init__.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/events.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/messagebus.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/queries.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/py.typed +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/unit_of_work.py +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit_python.egg-info/dependency_links.txt +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit_python.egg-info/requires.txt +0 -0
- {explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: explicit-python
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Набор компонентов для построения многослойной архитектуры
|
|
5
5
|
Author: BARS Group
|
|
6
6
|
Author-email: education_dev@bars-open.ru
|
|
@@ -18,6 +18,14 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
Requires-Dist: pydantic<2.0
|
|
20
20
|
Requires-Dist: more_itertools
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
21
29
|
|
|
22
30
|
# Explicit
|
|
23
31
|
## Набор компонентов для построения явной (Explicit) многослойной архитектуры
|
|
@@ -10,6 +10,8 @@ from pydantic.main import BaseModel
|
|
|
10
10
|
|
|
11
11
|
from explicit.domain import HasUnsetValues
|
|
12
12
|
|
|
13
|
+
from .exceptions import NoHandlerError
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
class Command(HasUnsetValues, BaseModel):
|
|
15
17
|
|
|
@@ -78,6 +80,7 @@ class CommandBusMixin(ABC):
|
|
|
78
80
|
|
|
79
81
|
def add_command_handler(self, command: Type[Command], handler: CommandHandler) -> None:
|
|
80
82
|
"""Регистрация обработчика команды."""
|
|
83
|
+
|
|
81
84
|
assert issubclass(command, Command)
|
|
82
85
|
assert callable(handler)
|
|
83
86
|
self._command_handlers[command] = handler
|
|
@@ -87,14 +90,16 @@ class CommandBusMixin(ABC):
|
|
|
87
90
|
*handlers: Tuple[Type[Command], CommandHandler]
|
|
88
91
|
) -> None:
|
|
89
92
|
"""Регистрация обработчиков команд."""
|
|
93
|
+
|
|
90
94
|
for command, handler in handlers:
|
|
91
95
|
self.add_command_handler(command, handler)
|
|
92
96
|
|
|
93
97
|
def handle_command(self, command: Command):
|
|
94
|
-
"""Передача запроса обработчику типа
|
|
98
|
+
"""Передача запроса обработчику типа данной команды."""
|
|
95
99
|
|
|
96
100
|
assert isinstance(command, Command)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
handler = self._command_handlers.get(type(command))
|
|
102
|
+
if handler is None:
|
|
103
|
+
raise NoHandlerError(type(command))
|
|
104
|
+
|
|
105
|
+
return handler(command)
|
{explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/messagebus/dependency_injection.py
RENAMED
|
@@ -16,12 +16,24 @@ class UnknownDependencyError(Exception):
|
|
|
16
16
|
"""Ожидаемая обработчиком зависимость не зарегистрирована."""
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
class AlreadyRegisteredDependencyError(Exception):
|
|
20
|
+
"""Зависимость с таким именем уже зарегистрирована."""
|
|
21
|
+
|
|
22
|
+
|
|
19
23
|
class DependencyInjectionMixin:
|
|
20
24
|
|
|
21
25
|
"""Примесь к шине сообщений, реализует управление зависимостями и их внедрение."""
|
|
22
26
|
|
|
23
27
|
_dependencies: Dict[str, Callable]
|
|
24
28
|
|
|
29
|
+
def register_dependency(self, alias: str, dependency: Callable):
|
|
30
|
+
"""Зарегистрировать зависимость."""
|
|
31
|
+
if alias in self._dependencies:
|
|
32
|
+
raise AlreadyRegisteredDependencyError(f'Зависимость с именем {alias} именем уже зарегистрирована')
|
|
33
|
+
|
|
34
|
+
self._dependencies[alias] = dependency
|
|
35
|
+
logger.debug('Зарегистрирована зависимость %s', alias)
|
|
36
|
+
|
|
25
37
|
def _set_dependencies(self, **dependencies: Any):
|
|
26
38
|
"""Заменяет внутреннее сопоставление зависимостей."""
|
|
27
39
|
self._dependencies = dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: explicit-python
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Набор компонентов для построения многослойной архитектуры
|
|
5
5
|
Author: BARS Group
|
|
6
6
|
Author-email: education_dev@bars-open.ru
|
|
@@ -18,6 +18,14 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
Requires-Dist: pydantic<2.0
|
|
20
20
|
Requires-Dist: more_itertools
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
21
29
|
|
|
22
30
|
# Explicit
|
|
23
31
|
## Набор компонентов для построения явной (Explicit) многослойной архитектуры
|
|
@@ -25,6 +25,7 @@ src/explicit/messagebus/__init__.py
|
|
|
25
25
|
src/explicit/messagebus/commands.py
|
|
26
26
|
src/explicit/messagebus/dependency_injection.py
|
|
27
27
|
src/explicit/messagebus/events.py
|
|
28
|
+
src/explicit/messagebus/exceptions.py
|
|
28
29
|
src/explicit/messagebus/messagebus.py
|
|
29
30
|
src/explicit/messagebus/queries.py
|
|
30
31
|
src/explicit_python.egg-info/PKG-INFO
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# нормальной установки обновлений.
|
|
5
5
|
|
|
6
6
|
[version]
|
|
7
|
-
BRANCH = tags/2.
|
|
8
|
-
VERSION = 2.
|
|
9
|
-
REVISION =
|
|
10
|
-
VERSION_DATE =
|
|
11
|
-
REVISION_DATE =
|
|
7
|
+
BRANCH = tags/2.3.1
|
|
8
|
+
VERSION = 2.3.1
|
|
9
|
+
REVISION = e53df817ef68c829e650d832e2fc7d3003df2777
|
|
10
|
+
VERSION_DATE = 17.10.2025
|
|
11
|
+
REVISION_DATE = 17.10.2025
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/domain/model/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/contrib/messagebus/event_registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit/domain/validation/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{explicit_python-2.2.1 → explicit_python-2.3.1}/src/explicit_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|