explicit-python 3.1.0__py3-none-any.whl → 3.1.1__py3-none-any.whl
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/messagebus/dependency_injection.py +15 -1
- {explicit_python-3.1.0.dist-info → explicit_python-3.1.1.dist-info}/METADATA +1 -1
- {explicit_python-3.1.0.dist-info → explicit_python-3.1.1.dist-info}/RECORD +6 -6
- {explicit_python-3.1.0.dist-info → explicit_python-3.1.1.dist-info}/WHEEL +0 -0
- {explicit_python-3.1.0.dist-info → explicit_python-3.1.1.dist-info}/licenses/LICENSE +0 -0
- {explicit_python-3.1.0.dist-info → explicit_python-3.1.1.dist-info}/top_level.txt +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import inspect
|
|
4
4
|
import logging
|
|
5
|
+
import sys
|
|
5
6
|
from collections.abc import (
|
|
6
7
|
Callable,
|
|
7
8
|
)
|
|
@@ -17,6 +18,19 @@ logger = logging.getLogger(__name__)
|
|
|
17
18
|
logger.setLevel(logging.INFO)
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
# На 3.14+ не вычисляем аннотации (PEP 649 / TYPE_CHECKING).
|
|
22
|
+
# kwargs передаём распаковкой: pylint на 3.10 не знает annotation_format.
|
|
23
|
+
_SIGNATURE_KWARGS: dict[str, Any] = {}
|
|
24
|
+
if sys.version_info >= (3, 14):
|
|
25
|
+
import annotationlib
|
|
26
|
+
|
|
27
|
+
_SIGNATURE_KWARGS['annotation_format'] = annotationlib.Format.STRING
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _signature(target: Callable) -> inspect.Signature:
|
|
31
|
+
return inspect.signature(target, **_SIGNATURE_KWARGS)
|
|
32
|
+
|
|
33
|
+
|
|
20
34
|
class UnknownDependencyError(Exception):
|
|
21
35
|
"""Ожидаемая обработчиком зависимость не зарегистрирована."""
|
|
22
36
|
|
|
@@ -53,7 +67,7 @@ class DependencyInjectionMixin:
|
|
|
53
67
|
"""Внедряет зависимости в target."""
|
|
54
68
|
exclude = exclude or set()
|
|
55
69
|
|
|
56
|
-
target_signature =
|
|
70
|
+
target_signature = _signature(target)
|
|
57
71
|
# определяем зависимости, которые ожидает обработчик
|
|
58
72
|
deps = {name: self._get_dependency(name) for name in target_signature.parameters.keys() if name not in exclude}
|
|
59
73
|
logger.debug('В обработчик %s внедрены зависимости %s', target, deps)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: explicit-python
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.1
|
|
4
4
|
Summary: Набор компонентов для построения многослойной архитектуры
|
|
5
5
|
Author-email: BARS Group <bars@bars-open.ru>
|
|
6
6
|
Project-URL: Homepage, https://stash.bars-open.ru/projects/EDUBASE/repos/explicit/browse
|
|
@@ -19,13 +19,13 @@ explicit/domain/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
|
19
19
|
explicit/domain/validation/exceptions.py,sha256=lDbF_PRcZg5RAh69YiEtCpGuuNMEw2Izb-baoPTteAw,5593
|
|
20
20
|
explicit/messagebus/__init__.py,sha256=ozV8d0c9dCa9IFOmndQEbgMdXEXSTWdQxuzT8CWiPrU,135
|
|
21
21
|
explicit/messagebus/commands.py,sha256=vEtq2LelPfpIC6YOTeVQU3zzcSm_lsc8_BiEHUmBM7k,3019
|
|
22
|
-
explicit/messagebus/dependency_injection.py,sha256=
|
|
22
|
+
explicit/messagebus/dependency_injection.py,sha256=9-TKx31UsLe7hY-xThccdk5y5zH7mMHqAKE2TKx3Xfs,2989
|
|
23
23
|
explicit/messagebus/events.py,sha256=4OgsiFceNGEIqo1KJnqzy0cWgc88jismplpd45CnmJQ,3244
|
|
24
24
|
explicit/messagebus/exceptions.py,sha256=avWn_ex665jJHu7Jj8EBjs79Tq2ZvY2rveZOA6aHB-s,375
|
|
25
25
|
explicit/messagebus/messagebus.py,sha256=9XhP256iL9XvmEazkEnr5l52uUEKW_rNFl81HpHrHrQ,3593
|
|
26
26
|
explicit/messagebus/queries.py,sha256=OpfJS4WNnFOYy1M-rIlkHT78Wkob5LDOjOZ9B3xCTt0,1567
|
|
27
|
-
explicit_python-3.1.
|
|
28
|
-
explicit_python-3.1.
|
|
29
|
-
explicit_python-3.1.
|
|
30
|
-
explicit_python-3.1.
|
|
31
|
-
explicit_python-3.1.
|
|
27
|
+
explicit_python-3.1.1.dist-info/licenses/LICENSE,sha256=CCIO8Y288mm2F53WG2U6QkY7qS7lthANGujcVt6fRlo,3455
|
|
28
|
+
explicit_python-3.1.1.dist-info/METADATA,sha256=Ka8bJbuLu8oKwjWn73CCnCJMG7B6wE82U5gQE1_qqrg,14580
|
|
29
|
+
explicit_python-3.1.1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
30
|
+
explicit_python-3.1.1.dist-info/top_level.txt,sha256=tt6T8l4Yji4ww87qZQcD4CbcwTIHy7NAPmU7QAfMcpY,9
|
|
31
|
+
explicit_python-3.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|