orionis 0.367.0__py3-none-any.whl → 0.369.0__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.
- orionis/container/contracts/resolver.py +58 -0
- orionis/container/resolver/resolver.py +2 -1
- orionis/foundation/application.py +11 -2
- orionis/metadata/framework.py +1 -1
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/METADATA +1 -1
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/RECORD +10 -9
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/WHEEL +0 -0
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/top_level.txt +0 -0
- {orionis-0.367.0.dist-info → orionis-0.369.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any
|
|
3
|
+
from orionis.container.contracts.container import IContainer
|
|
4
|
+
from orionis.container.entities.binding import Binding
|
|
5
|
+
|
|
6
|
+
class IResolver(ABC):
|
|
7
|
+
"""
|
|
8
|
+
Interface for dependency resolution in the container system.
|
|
9
|
+
|
|
10
|
+
This interface defines the contract for resolvers that handle
|
|
11
|
+
dependency injection and instance creation based on bindings.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def __init__(self, container: IContainer) -> None:
|
|
16
|
+
"""
|
|
17
|
+
Initialize the resolver with a container reference.
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
container : IContainer
|
|
22
|
+
The container instance that this resolver will use to resolve dependencies.
|
|
23
|
+
"""
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
@abstractmethod
|
|
27
|
+
def resolve(
|
|
28
|
+
self,
|
|
29
|
+
binding: Binding,
|
|
30
|
+
*args,
|
|
31
|
+
**kwargs
|
|
32
|
+
) -> Any:
|
|
33
|
+
"""
|
|
34
|
+
Resolves an instance from a binding.
|
|
35
|
+
|
|
36
|
+
This method resolves an instance based on the binding's lifetime and type.
|
|
37
|
+
It delegates to specific resolution methods based on the lifetime (transient, singleton, or scoped).
|
|
38
|
+
|
|
39
|
+
Parameters
|
|
40
|
+
----------
|
|
41
|
+
binding : Binding
|
|
42
|
+
The binding to resolve.
|
|
43
|
+
*args : tuple
|
|
44
|
+
Additional positional arguments to pass to the constructor.
|
|
45
|
+
**kwargs : dict
|
|
46
|
+
Additional keyword arguments to pass to the constructor.
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
-------
|
|
50
|
+
Any
|
|
51
|
+
The resolved instance.
|
|
52
|
+
|
|
53
|
+
Raises
|
|
54
|
+
------
|
|
55
|
+
OrionisContainerException
|
|
56
|
+
If the binding is not an instance of Binding or if resolution fails.
|
|
57
|
+
"""
|
|
58
|
+
pass
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Any, Callable
|
|
2
2
|
from orionis.container.context.scope import ScopedContext
|
|
3
3
|
from orionis.container.contracts.container import IContainer
|
|
4
|
+
from orionis.container.contracts.resolver import IResolver
|
|
4
5
|
from orionis.container.entities.binding import Binding
|
|
5
6
|
from orionis.container.enums.lifetimes import Lifetime
|
|
6
7
|
from orionis.container.exceptions import OrionisContainerException
|
|
@@ -8,7 +9,7 @@ from orionis.services.introspection.callables.reflection import ReflectionCallab
|
|
|
8
9
|
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
9
10
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
10
11
|
|
|
11
|
-
class Resolver:
|
|
12
|
+
class Resolver(IResolver):
|
|
12
13
|
"""
|
|
13
14
|
Resolver class for handling dependency resolution in the container.
|
|
14
15
|
"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Type, List
|
|
2
2
|
from orionis.container.container import Container
|
|
3
3
|
from orionis.container.contracts.service_provider import IServiceProvider
|
|
4
|
-
from orionis.foundation.providers.dumper_provider import DebugProvider
|
|
5
4
|
|
|
6
5
|
class App(Container):
|
|
7
6
|
"""
|
|
@@ -98,8 +97,18 @@ class App(Container):
|
|
|
98
97
|
This method should register core services required by the framework
|
|
99
98
|
before user-defined providers are loaded.
|
|
100
99
|
"""
|
|
100
|
+
from orionis.foundation.providers.console_provider import ConsoleProvider
|
|
101
|
+
from orionis.foundation.providers.dumper_provider import DumperProvider
|
|
102
|
+
from orionis.foundation.providers.path_resolver_provider import PathResolverProvider
|
|
103
|
+
from orionis.foundation.providers.progress_bar_provider import ProgressBarProvider
|
|
104
|
+
from orionis.foundation.providers.workers_provider import WorkersProvider
|
|
105
|
+
|
|
101
106
|
core_providers = [
|
|
102
|
-
|
|
107
|
+
ConsoleProvider,
|
|
108
|
+
DumperProvider,
|
|
109
|
+
PathResolverProvider,
|
|
110
|
+
ProgressBarProvider,
|
|
111
|
+
WorkersProvider
|
|
103
112
|
]
|
|
104
113
|
|
|
105
114
|
for provider_cls in core_providers:
|
orionis/metadata/framework.py
CHANGED
|
@@ -117,6 +117,7 @@ orionis/container/context/manager.py,sha256=9yODWkHBoJ2kgJZ5ONLqcEcex50vaWuMcxsv
|
|
|
117
117
|
orionis/container/context/scope.py,sha256=CWFiLLTAC_IdmeFKWX-jrphdxB0_TMEVBlz6lQVMPC8,937
|
|
118
118
|
orionis/container/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
119
119
|
orionis/container/contracts/container.py,sha256=hOO3w2yqVhp2nPTeS1uJEYgXSTbM3xwezDCOSNMC_a0,7603
|
|
120
|
+
orionis/container/contracts/resolver.py,sha256=mR7lztPAQDwyspoQewaTMQPxJaoOCA88euDevaZYHGo,1712
|
|
120
121
|
orionis/container/contracts/service_provider.py,sha256=hXp-l4iP7q0FhsCcQAKoYcJ_zxCzIgTdfmO4F0Bbssg,896
|
|
121
122
|
orionis/container/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
122
123
|
orionis/container/entities/binding.py,sha256=hoGTsIn8AbUdrYmyuE7bfwmFxss1zx35EPuDV1VwtKM,4321
|
|
@@ -132,7 +133,7 @@ orionis/container/facades/facade.py,sha256=22AMMDEqfUCIj2EsGTnjTKLsnLq3QhhqpV6mp
|
|
|
132
133
|
orionis/container/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
133
134
|
orionis/container/providers/service_provider.py,sha256=9SHDzeuJbktRhrLq0zo2fZhRR4xOaYGOb2wKl7iBR4k,1923
|
|
134
135
|
orionis/container/resolver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
135
|
-
orionis/container/resolver/resolver.py,sha256=
|
|
136
|
+
orionis/container/resolver/resolver.py,sha256=prEpMxx1bLV8d-TjMeXezrKPO1sntrMiawGiK3RSKc4,18047
|
|
136
137
|
orionis/container/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
137
138
|
orionis/container/validators/implements.py,sha256=xDXK7yhG5GGGRT9Mj1UbbVrcVTgifmjFZdaAJG4Ke8o,3110
|
|
138
139
|
orionis/container/validators/is_abstract_class.py,sha256=vJqUPn610YZS0sEkV8c_gPZskIgWmFHjg3D3MF2OTs8,1141
|
|
@@ -144,7 +145,7 @@ orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYq
|
|
|
144
145
|
orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
|
|
145
146
|
orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
|
|
146
147
|
orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
|
-
orionis/foundation/application.py,sha256=
|
|
148
|
+
orionis/foundation/application.py,sha256=OiBbTI-4cGTEZppVaFxDHadvsb_jRl8aDwJEwlypVLg,4799
|
|
148
149
|
orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
150
|
orionis/foundation/config/startup.py,sha256=zutF-34DkW68bpiTxH9xrmIe1iJdXCF9Y6wueXS6qys,8265
|
|
150
151
|
orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -244,7 +245,7 @@ orionis/foundation/providers/path_resolver_provider.py,sha256=rXvaVc5sSqmDgRzWJo
|
|
|
244
245
|
orionis/foundation/providers/progress_bar_provider.py,sha256=75Jr4iEgUOUGl8Di1DioeP5_HRQlR-1lVzPmS96sWjA,737
|
|
245
246
|
orionis/foundation/providers/workers_provider.py,sha256=WWlji3C69_-Y0c42aZDbR_bmcE_qZEh2SaA_cNkCivI,702
|
|
246
247
|
orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
247
|
-
orionis/metadata/framework.py,sha256=
|
|
248
|
+
orionis/metadata/framework.py,sha256=wnTEOp5_Ho2LPyVNN9sB_p_JDKUcVZQZKG08IJ3Uk8c,4960
|
|
248
249
|
orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
|
|
249
250
|
orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
250
251
|
orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -376,7 +377,7 @@ orionis/test/output/dumper.py,sha256=3EV-G3KgEV4O0M4yl-4klPKc1etWOPZvPAcYhUQyXnI
|
|
|
376
377
|
orionis/test/output/printer.py,sha256=WGjGW2lgu_l5wWJ6Z8qTTV7NAObhoTBcvhM1TcNvwU4,16938
|
|
377
378
|
orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
378
379
|
orionis/test/view/render.py,sha256=jXZkbITBknbUwm_mD8bcTiwLDvsFkrO9qrf0ZgPwqxc,4903
|
|
379
|
-
orionis-0.
|
|
380
|
+
orionis-0.369.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
|
380
381
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
381
382
|
tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
382
383
|
tests/example/test_example.py,sha256=kvWgiW3ADEZf718dGsMPtDh_rmOSx1ypEInKm7_6ZPQ,601
|
|
@@ -477,8 +478,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=hIVqGt19vbW22xPjQS
|
|
|
477
478
|
tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
478
479
|
tests/testing/test_testing_result.py,sha256=1O_8xjsFPnzwZOpLT6ImqjO9HY5_jIgP7DTVBsgHvQA,4335
|
|
479
480
|
tests/testing/test_testing_unit.py,sha256=S3anwYcF2DBWYh_UfqKcZq2FgNpQjP0SfYVRd5sD5rI,7442
|
|
480
|
-
orionis-0.
|
|
481
|
-
orionis-0.
|
|
482
|
-
orionis-0.
|
|
483
|
-
orionis-0.
|
|
484
|
-
orionis-0.
|
|
481
|
+
orionis-0.369.0.dist-info/METADATA,sha256=EVeODoCcsbW2vwJOt5wNIEkVmJC2Al9RfsVShCrPxNo,4772
|
|
482
|
+
orionis-0.369.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
483
|
+
orionis-0.369.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
|
484
|
+
orionis-0.369.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
485
|
+
orionis-0.369.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|