orionis 0.162.0__py3-none-any.whl → 0.163.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/framework.py +1 -1
- orionis/luminate/container/container.py +23 -15
- orionis/luminate/providers/commands/reactor_commands_service_provider.py +2 -2
- orionis/luminate/providers/environment/environment__service_provider.py +2 -2
- orionis/luminate/providers/files/paths_provider.py +2 -2
- orionis/luminate/providers/log/log_service_provider.py +2 -2
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/METADATA +1 -1
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/RECORD +12 -12
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/LICENCE +0 -0
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/WHEEL +0 -0
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/entry_points.txt +0 -0
- {orionis-0.162.0.dist-info → orionis-0.163.0.dist-info}/top_level.txt +0 -0
orionis/framework.py
CHANGED
@@ -411,24 +411,31 @@ class Container(IContainer):
|
|
411
411
|
if abstract_or_alias in self._singleton_services:
|
412
412
|
if abstract_or_alias not in self._singleton_instances:
|
413
413
|
service = self._singleton_services[abstract_or_alias]
|
414
|
-
self._singleton_instances[abstract_or_alias] =
|
414
|
+
self._singleton_instances[abstract_or_alias] = (
|
415
|
+
await self._resolve(service['concrete']) if service['async']
|
416
|
+
else self._resolve(service['concrete'])
|
417
|
+
)
|
415
418
|
return self._singleton_instances[abstract_or_alias]
|
416
419
|
|
417
420
|
if abstract_or_alias in self._scoped_services:
|
418
421
|
if abstract_or_alias not in self._scoped_instances:
|
419
422
|
service = self._scoped_services[abstract_or_alias]
|
420
|
-
self._scoped_instances[abstract_or_alias] =
|
423
|
+
self._scoped_instances[abstract_or_alias] = (
|
424
|
+
await self._resolve(service['concrete']) if service['async']
|
425
|
+
else self._resolve(service['concrete'])
|
426
|
+
)
|
421
427
|
return self._scoped_instances[abstract_or_alias]
|
422
428
|
|
423
429
|
if abstract_or_alias in self._transient_services:
|
424
430
|
service = self._transient_services[abstract_or_alias]
|
425
|
-
return await service['concrete']
|
431
|
+
return await self._resolve(service['concrete']) if service['async'] else self._resolve(service['concrete'])
|
426
432
|
|
427
433
|
raise OrionisContainerException(f"No binding found for '{abstract_or_alias}' in the container.")
|
428
434
|
|
429
|
-
|
435
|
+
|
436
|
+
async def _resolve(self, concrete: Callable[..., Any], resolving: Optional[Deque[Type]] = None) -> Any:
|
430
437
|
"""
|
431
|
-
|
438
|
+
Asynchronous method to resolve dependencies recursively and instantiate a class.
|
432
439
|
|
433
440
|
Parameters
|
434
441
|
----------
|
@@ -449,7 +456,7 @@ class Container(IContainer):
|
|
449
456
|
|
450
457
|
Examples
|
451
458
|
--------
|
452
|
-
>>> instance = container._resolve(MyClass)
|
459
|
+
>>> instance = await container._resolve(MyClass)
|
453
460
|
"""
|
454
461
|
|
455
462
|
if resolving is None:
|
@@ -491,16 +498,16 @@ class Container(IContainer):
|
|
491
498
|
|
492
499
|
if isinstance(param_type, type) and not issubclass(param_type, (int, str, bool, float)):
|
493
500
|
if self.has(param_type):
|
494
|
-
resolved_dependencies[param_name] = self.make(
|
501
|
+
resolved_dependencies[param_name] = await self.make(param_type)
|
495
502
|
else:
|
496
|
-
resolved_dependencies[param_name] = self._resolve_dependency(param_type, resolving)
|
503
|
+
resolved_dependencies[param_name] = await self._resolve_dependency(param_type, resolving)
|
497
504
|
else:
|
498
505
|
resolved_dependencies[param_name] = param_type
|
499
506
|
|
500
507
|
while unresolved_dependencies:
|
501
508
|
dep_name = unresolved_dependencies.popleft()
|
502
509
|
if dep_name not in resolved_dependencies:
|
503
|
-
resolved_dependencies[dep_name] = self._resolve_dependency(dep_name, resolving)
|
510
|
+
resolved_dependencies[dep_name] = await self._resolve_dependency(dep_name, resolving)
|
504
511
|
|
505
512
|
try:
|
506
513
|
instance = concrete(**resolved_dependencies)
|
@@ -509,9 +516,10 @@ class Container(IContainer):
|
|
509
516
|
except Exception as e:
|
510
517
|
raise OrionisContainerException(f"Failed to instantiate {concrete}: {str(e)}")
|
511
518
|
|
512
|
-
|
519
|
+
|
520
|
+
async def _resolve_dependency(self, dep_type: Any, resolving: Optional[Deque[Type]] = None) -> Any:
|
513
521
|
"""
|
514
|
-
|
522
|
+
Asynchronously resolves a dependency by instantiating or retrieving it from the container.
|
515
523
|
|
516
524
|
Parameters
|
517
525
|
----------
|
@@ -532,7 +540,7 @@ class Container(IContainer):
|
|
532
540
|
|
533
541
|
Examples
|
534
542
|
--------
|
535
|
-
>>> dependency = container._resolve_dependency(MyDependency)
|
543
|
+
>>> dependency = await container._resolve_dependency(MyDependency)
|
536
544
|
"""
|
537
545
|
|
538
546
|
if resolving is None:
|
@@ -540,8 +548,8 @@ class Container(IContainer):
|
|
540
548
|
|
541
549
|
if isinstance(dep_type, type):
|
542
550
|
if self.has(dep_type):
|
543
|
-
return self.make(
|
551
|
+
return await self.make(dep_type)
|
544
552
|
else:
|
545
|
-
return self._resolve(dep_type, resolving)
|
553
|
+
return await self._resolve(dep_type, resolving)
|
546
554
|
|
547
|
-
raise OrionisContainerException(f"Cannot resolve dependency of type {dep_type}")
|
555
|
+
raise OrionisContainerException(f"Cannot resolve dependency of type {dep_type}")
|
@@ -10,11 +10,11 @@ class ReactorCommandsServiceProvider(ServiceProvider):
|
|
10
10
|
"""
|
11
11
|
self.app.singleton(IReactorCommandsService, ReactorCommandsService)
|
12
12
|
|
13
|
-
def boot(self) -> None:
|
13
|
+
async def boot(self) -> None:
|
14
14
|
"""
|
15
15
|
Boot the service provider.
|
16
16
|
|
17
17
|
This method is intended to be overridden by subclasses to perform
|
18
18
|
any necessary bootstrapping or initialization tasks.
|
19
19
|
"""
|
20
|
-
self.app.make(IReactorCommandsService)
|
20
|
+
await self.app.make(IReactorCommandsService)
|
@@ -11,11 +11,11 @@ class EnvironmentServiceProvider(ServiceProvider):
|
|
11
11
|
"""
|
12
12
|
self.app.singleton(IEnvironmentService, EnvironmentService)
|
13
13
|
|
14
|
-
def boot(self) -> None:
|
14
|
+
async def boot(self) -> None:
|
15
15
|
"""
|
16
16
|
Boot the service provider.
|
17
17
|
|
18
18
|
This method is intended to be overridden by subclasses to perform
|
19
19
|
any necessary bootstrapping or initialization tasks.
|
20
20
|
"""
|
21
|
-
self.app.make(IEnvironmentService)
|
21
|
+
await self.app.make(IEnvironmentService)
|
@@ -10,11 +10,11 @@ class PathResolverProvider(ServiceProvider):
|
|
10
10
|
"""
|
11
11
|
self.app.singleton(IPathResolverService, PathResolverService)
|
12
12
|
|
13
|
-
def boot(self) -> None:
|
13
|
+
async def boot(self) -> None:
|
14
14
|
"""
|
15
15
|
Boot the service provider.
|
16
16
|
|
17
17
|
This method is intended to be overridden by subclasses to perform
|
18
18
|
any necessary bootstrapping or initialization tasks.
|
19
19
|
"""
|
20
|
-
self.app.make(IPathResolverService)
|
20
|
+
await self.app.make(IPathResolverService)
|
@@ -10,11 +10,11 @@ class LogServiceProvider(ServiceProvider):
|
|
10
10
|
"""
|
11
11
|
self.app.singleton(ILogguerService, LogguerService)
|
12
12
|
|
13
|
-
def boot(self) -> None:
|
13
|
+
async def boot(self) -> None:
|
14
14
|
"""
|
15
15
|
Boot the service provider.
|
16
16
|
|
17
17
|
This method is intended to be overridden by subclasses to perform
|
18
18
|
any necessary bootstrapping or initialization tasks.
|
19
19
|
"""
|
20
|
-
self.app.make(ILogguerService)
|
20
|
+
await self.app.make(ILogguerService)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
orionis/cli_manager.py,sha256=oXY5UYvtalP996h7z5iaEc7z5b1hyFWXrLPrvtoxWcU,1368
|
3
|
-
orionis/framework.py,sha256=
|
3
|
+
orionis/framework.py,sha256=f1GAANqF3O6RYZ2IMZj0-FLdrWAIbopegA0suP38Csc,1387
|
4
4
|
orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
orionis/installer/manager.py,sha256=SiypGJ2YiFeWyK_4drkheHUd42oS2CH63PNuxiw6Cps,3139
|
6
6
|
orionis/installer/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -44,7 +44,7 @@ orionis/luminate/console/output/executor.py,sha256=91722rNiAsKpuq5QYiI7Aqw_7ccmn
|
|
44
44
|
orionis/luminate/console/output/progress_bar.py,sha256=ZiPGcUaN3EINeLRKgLGtS1GAb1XWlCDx7wFQ7Ff0hqY,3096
|
45
45
|
orionis/luminate/console/output/styles.py,sha256=2e1_FJdNpKaVqmdlCx-udzTleH_6uEFE9_TjH7T1ZUk,3696
|
46
46
|
orionis/luminate/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
47
|
-
orionis/luminate/container/container.py,sha256=
|
47
|
+
orionis/luminate/container/container.py,sha256=mnshEwdYfnHLypL2G-UQAMmvvWP3RhRBVIJipFPmCOc,18641
|
48
48
|
orionis/luminate/container/container_integrity.py,sha256=lFQ41IN_3Z0SbtJzZ_9jewoaUI4xlsBEFXPfn-p82uI,7976
|
49
49
|
orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
|
50
50
|
orionis/luminate/container/lifetimes.py,sha256=2lbdiV7R2WlJf1cLD6eBxLnJud_lZvX1IhQH2Djy3Ww,375
|
@@ -139,16 +139,16 @@ orionis/luminate/patterns/singleton.py,sha256=b3U0nubKSQWyal5wTXADVPtOztkaTk-M8Z
|
|
139
139
|
orionis/luminate/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
140
140
|
orionis/luminate/providers/service_provider.py,sha256=dENh4rs9LRSx0gDiWu6cE3-O3Rl5v06JPkA0mYDwYt8,1471
|
141
141
|
orionis/luminate/providers/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
142
|
-
orionis/luminate/providers/commands/reactor_commands_service_provider.py,sha256=
|
142
|
+
orionis/luminate/providers/commands/reactor_commands_service_provider.py,sha256=32bGJ35IsDarofSqvNE1WWfpHL_dCyoGpABaLeRWHN0,828
|
143
143
|
orionis/luminate/providers/commands/scheduler_provider.py,sha256=7Pq6V58UcJrQvhSDgNrQ6Z4KTO6_Jzp6EoP8oqPLsQg,485
|
144
144
|
orionis/luminate/providers/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
145
145
|
orionis/luminate/providers/config/config_service_provider.py,sha256=UWozQ84StJjn3x2gjqslLAu5P1GqgPzSvj-91hgfapk,466
|
146
146
|
orionis/luminate/providers/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
147
|
-
orionis/luminate/providers/environment/environment__service_provider.py,sha256=
|
147
|
+
orionis/luminate/providers/environment/environment__service_provider.py,sha256=Mk3CzEPlANZyuvfwBlMJi3eI91MU4wkfvUme-GEwDfg,887
|
148
148
|
orionis/luminate/providers/files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
149
|
-
orionis/luminate/providers/files/paths_provider.py,sha256=
|
149
|
+
orionis/luminate/providers/files/paths_provider.py,sha256=S9wm9r2jaMwFcz3qpOTHKCwvqccqaU40xyAiBOhbZTs,791
|
150
150
|
orionis/luminate/providers/log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
151
|
-
orionis/luminate/providers/log/log_service_provider.py,sha256=
|
151
|
+
orionis/luminate/providers/log/log_service_provider.py,sha256=4mXkd9kTKW8dsqe6ScbEDO7b6GsFgAfu9vFJNjECZlw,740
|
152
152
|
orionis/luminate/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
153
153
|
orionis/luminate/services/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
154
154
|
orionis/luminate/services/commands/reactor_commands_service.py,sha256=rLTAZYEoaVsGXqSKk6nfgVghYIhh29wexWuyldPvjiA,6279
|
@@ -181,9 +181,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
181
181
|
tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
182
182
|
tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
|
183
183
|
tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
|
184
|
-
orionis-0.
|
185
|
-
orionis-0.
|
186
|
-
orionis-0.
|
187
|
-
orionis-0.
|
188
|
-
orionis-0.
|
189
|
-
orionis-0.
|
184
|
+
orionis-0.163.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
|
185
|
+
orionis-0.163.0.dist-info/METADATA,sha256=-d74sXppzFqAg7NitjGlKNarTHjC5LXy-IMXb-DGrxI,2970
|
186
|
+
orionis-0.163.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
187
|
+
orionis-0.163.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
|
188
|
+
orionis-0.163.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
|
189
|
+
orionis-0.163.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|