orionis 0.366.0__py3-none-any.whl → 0.368.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.
@@ -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
  """
@@ -12,7 +12,7 @@ class ConsoleProvider(ServiceProvider):
12
12
  """
13
13
  Register services into the application container.
14
14
  """
15
- self.app.transient(IConsole, Console, alias="console")
15
+ self.app.transient(IConsole, Console, alias="core.orionis.console")
16
16
 
17
17
  def boot(self) -> None:
18
18
  """
@@ -12,7 +12,7 @@ class DumperProvider(ServiceProvider):
12
12
  """
13
13
  Register services into the application container.
14
14
  """
15
- self.app.transient(IDebug, Debug, alias="dumper")
15
+ self.app.transient(IDebug, Debug, alias="core.orionis.dumper")
16
16
 
17
17
  def boot(self) -> None:
18
18
  """
@@ -0,0 +1,21 @@
1
+ from orionis.container.providers.service_provider import ServiceProvider
2
+ from orionis.services.paths.contracts.resolver import IResolver
3
+ from orionis.services.paths.resolver import Resolver
4
+
5
+ class PathResolverProvider(ServiceProvider):
6
+ """
7
+ Debug provider for the Orionis framework.
8
+ This provider is responsible for debugging functionalities.
9
+ """
10
+
11
+ def register(self) -> None:
12
+ """
13
+ Register services into the application container.
14
+ """
15
+ self.app.transient(IResolver, Resolver, alias="core.orionis.path_resolver")
16
+
17
+ def boot(self) -> None:
18
+ """
19
+ Perform any post-registration bootstrapping or initialization.
20
+ """
21
+ pass
@@ -12,7 +12,7 @@ class ProgressBarProvider(ServiceProvider):
12
12
  """
13
13
  Register services into the application container.
14
14
  """
15
- self.app.transient(IProgressBar, ProgressBar, alias="progress_bar")
15
+ self.app.transient(IProgressBar, ProgressBar, alias="core.orionis.progress_bar")
16
16
 
17
17
  def boot(self) -> None:
18
18
  """
@@ -0,0 +1,21 @@
1
+ from orionis.container.providers.service_provider import ServiceProvider
2
+ from orionis.services.system.contracts.workers import IWorkers
3
+ from orionis.services.system.workers import Workers
4
+
5
+ class WorkersProvider(ServiceProvider):
6
+ """
7
+ Debug provider for the Orionis framework.
8
+ This provider is responsible for debugging functionalities.
9
+ """
10
+
11
+ def register(self) -> None:
12
+ """
13
+ Register services into the application container.
14
+ """
15
+ self.app.transient(IWorkers, Workers, alias="core.orionis.workers")
16
+
17
+ def boot(self) -> None:
18
+ """
19
+ Perform any post-registration bootstrapping or initialization.
20
+ """
21
+ pass
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.366.0"
8
+ VERSION = "0.368.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -10,6 +10,18 @@ class IWorkers(ABC):
10
10
  according to the available CPU and memory resources of the current machine.
11
11
  """
12
12
 
13
+ @abstractmethod
14
+ def setRamPerWorker(self, ram_per_worker: float) -> None:
15
+ """
16
+ Set the amount of RAM allocated per worker.
17
+
18
+ Parameters
19
+ ----------
20
+ ram_per_worker : float
21
+ Amount of RAM (in GB) allocated per worker.
22
+ """
23
+ pass
24
+
13
25
  @abstractmethod
14
26
  def calculate(self) -> int:
15
27
  """
@@ -38,6 +38,17 @@ class Workers(IWorkers):
38
38
  self._ram_total_gb = psutil.virtual_memory().total / (1024 ** 3)
39
39
  self._ram_per_worker = ram_per_worker
40
40
 
41
+ def setRamPerWorker(self, ram_per_worker: float) -> None:
42
+ """
43
+ Set the amount of RAM allocated per worker.
44
+
45
+ Parameters
46
+ ----------
47
+ ram_per_worker : float
48
+ Amount of RAM (in GB) allocated per worker.
49
+ """
50
+ self._ram_per_worker = ram_per_worker
51
+
41
52
  def calculate(self) -> int:
42
53
  """
43
54
  Compute the maximum number of workers supported by the current machine.
@@ -12,4 +12,4 @@ class Console(Facade):
12
12
  str
13
13
  The service container binding key.
14
14
  """
15
- return "console"
15
+ return "core.orionis.console"
@@ -12,4 +12,4 @@ class Dumper(Facade):
12
12
  str
13
13
  The service container binding key.
14
14
  """
15
- return "dumper"
15
+ return "core.orionis.dumper"
@@ -0,0 +1,15 @@
1
+ from orionis.container.facades.facade import Facade
2
+
3
+ class PathResolver(Facade):
4
+
5
+ @classmethod
6
+ def getFacadeAccessor(cls):
7
+ """
8
+ Get the service container binding key for the dumper component.
9
+
10
+ Returns
11
+ -------
12
+ str
13
+ The service container binding key.
14
+ """
15
+ return "core.orionis.path_resolver"
@@ -12,4 +12,4 @@ class ProgressBar(Facade):
12
12
  str
13
13
  The service container binding key.
14
14
  """
15
- return "progress_bar"
15
+ return "core.orionis.progress_bar"
@@ -0,0 +1,15 @@
1
+ from orionis.container.facades.facade import Facade
2
+
3
+ class ProgressBar(Facade):
4
+
5
+ @classmethod
6
+ def getFacadeAccessor(cls):
7
+ """
8
+ Get the service container binding key for the dumper component.
9
+
10
+ Returns
11
+ -------
12
+ str
13
+ The service container binding key.
14
+ """
15
+ return "core.orionis.workers"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.366.0
3
+ Version: 0.368.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -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=YRohopELIol-UT17xrjNN-5ndefxJ790BZqBZcLZWMM,17976
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
@@ -238,11 +239,13 @@ orionis/foundation/exceptions/__init__.py,sha256=XtG3MJ_MFNY_dU5mmTyz_N_4QG1jYrc
238
239
  orionis/foundation/exceptions/integrity.py,sha256=mc4pL1UMoYRHEmphnpW2oGk5URhu7DJRREyzHaV-cs8,472
239
240
  orionis/foundation/exceptions/value.py,sha256=hQhXybXEnaa59ba7JxG65jceHt3mnql9MyekF-TChpM,465
240
241
  orionis/foundation/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
241
- orionis/foundation/providers/console_provider.py,sha256=Y7bdoZWaEh4ixU1u18wAz8UmV5sUJUvkU9jjQiB1c5A,687
242
- orionis/foundation/providers/dumper_provider.py,sha256=QdlJ2tJg0LVXnjkMy-LBmirmT1q0MVIyzMD6oA4FqP0,676
243
- orionis/foundation/providers/progress_bar_provider.py,sha256=fhp_GIm3O68dEcB6zSgcswQTcGXhOAFYCGZamWUXT2E,724
242
+ orionis/foundation/providers/console_provider.py,sha256=pAIklY1QKx2HKjTp7YyJT6KbJPlEEyzWSr79RTFkEK0,700
243
+ orionis/foundation/providers/dumper_provider.py,sha256=mLJDpNNNl4PV8oM_GKBvSxBcfXRxgiBlrA9Qg5WKi0A,689
244
+ orionis/foundation/providers/path_resolver_provider.py,sha256=rXvaVc5sSqmDgRzWJoattAW0ikO_SF3H7WBddVxwmhw,717
245
+ orionis/foundation/providers/progress_bar_provider.py,sha256=75Jr4iEgUOUGl8Di1DioeP5_HRQlR-1lVzPmS96sWjA,737
246
+ orionis/foundation/providers/workers_provider.py,sha256=WWlji3C69_-Y0c42aZDbR_bmcE_qZEh2SaA_cNkCivI,702
244
247
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
245
- orionis/metadata/framework.py,sha256=Hj5eKaWrsz5qSPsNvWlJKiN-i05Sb5Mw1OHEV0uEtt8,4960
248
+ orionis/metadata/framework.py,sha256=YsEon2YEhIiRW2ecIazUDyccCGpcyKzQwOgszAQA_fw,4960
246
249
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
247
250
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
248
251
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -313,17 +316,19 @@ orionis/services/paths/exceptions/exception.py,sha256=cK-TbUT02X2lvbAP4yFdfHx4S4
313
316
  orionis/services/paths/exceptions/file.py,sha256=bsK0QoXwRFyDeHvITxwmgaBuwiO2eoRUhRzNizmX1No,475
314
317
  orionis/services/system/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
315
318
  orionis/services/system/imports.py,sha256=5j2Rkf6vMLnCQjqcox4-0y0tZoxgPfv7EP8eruG7vnA,4990
316
- orionis/services/system/workers.py,sha256=1HJCLHEJ7VcQZ4dqs0lYLVafEzvowLRdLvKffV1fewA,1877
319
+ orionis/services/system/workers.py,sha256=QO5IXjH8BXWUlHzH1TiRKt3vn4LZklRI02nSL17hWPo,2199
317
320
  orionis/services/system/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
318
321
  orionis/services/system/contracts/imports.py,sha256=nE2fDS2bDbwltHCmzOsEMhUymYy092zoGX-NOXLE4J4,1167
319
- orionis/services/system/contracts/workers.py,sha256=aZfQlij6mkPM2TcodDai7JYpTFNKL4YFAEj8Bd9Y4nw,707
322
+ orionis/services/system/contracts/workers.py,sha256=plst9CcYqwkEcy-LPdfJbdKPKaeq8hmtWk0B5mlH2wo,1017
320
323
  orionis/services/system/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
321
324
  orionis/services/system/runtime/imports.py,sha256=eWp_MmrvxWHl-lsNO0M5FC9OsCcY1BXsiJTlPk0cfRU,2550
322
325
  orionis/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
323
326
  orionis/support/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
324
- orionis/support/facades/console.py,sha256=uYajLxlGls_DpzdoTXFuwkfIla95ZvkTlQ1SOBmmC84,359
325
- orionis/support/facades/dumper.py,sha256=XfvLYuAPRq6izHNsstA3Q221cvUxCnIz7RAURH-BQig,357
326
- orionis/support/facades/progress_bar.py,sha256=w_Wup5izzNdD7dPTw3hVCxKJDqUj5uXMc5g73x38CjU,361
327
+ orionis/support/facades/console.py,sha256=Hx_VGZazpdPDkg1LgcCTzgASq7blzazGHXVNp2uN5w8,372
328
+ orionis/support/facades/dumper.py,sha256=JD0xT11ReLlzTH1O5wdIG1-r9sg1nriJnhtqkLsavW8,370
329
+ orionis/support/facades/path_resolver.py,sha256=-ro3-yxmjKHngf6aOy2dzyeNulsiSJuxu__vJWsRuUA,376
330
+ orionis/support/facades/progress_bar.py,sha256=ZmU7hojRP88PM39BX1fN0_2pTCUhOXdIqyKaQwPoQ-A,374
331
+ orionis/support/facades/workers.py,sha256=P-ppMQOzexbkcLDiGPdIPVA41LRlgNZcW-aB890ujk8,369
327
332
  orionis/support/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
328
333
  orionis/support/formatter/serializer.py,sha256=g816osgwYzAzCnduDh2IyHvXx-fEhnVmw8EPZkDT5Ak,522
329
334
  orionis/support/formatter/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -372,7 +377,7 @@ orionis/test/output/dumper.py,sha256=3EV-G3KgEV4O0M4yl-4klPKc1etWOPZvPAcYhUQyXnI
372
377
  orionis/test/output/printer.py,sha256=WGjGW2lgu_l5wWJ6Z8qTTV7NAObhoTBcvhM1TcNvwU4,16938
373
378
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
374
379
  orionis/test/view/render.py,sha256=jXZkbITBknbUwm_mD8bcTiwLDvsFkrO9qrf0ZgPwqxc,4903
375
- orionis-0.366.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
380
+ orionis-0.368.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
376
381
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
377
382
  tests/example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
378
383
  tests/example/test_example.py,sha256=kvWgiW3ADEZf718dGsMPtDh_rmOSx1ypEInKm7_6ZPQ,601
@@ -473,8 +478,8 @@ tests/support/wrapper/test_services_wrapper_docdict.py,sha256=hIVqGt19vbW22xPjQS
473
478
  tests/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
474
479
  tests/testing/test_testing_result.py,sha256=1O_8xjsFPnzwZOpLT6ImqjO9HY5_jIgP7DTVBsgHvQA,4335
475
480
  tests/testing/test_testing_unit.py,sha256=S3anwYcF2DBWYh_UfqKcZq2FgNpQjP0SfYVRd5sD5rI,7442
476
- orionis-0.366.0.dist-info/METADATA,sha256=6wSc8VpRqYC_ty0j9_IaSSxU8xsWlAkzxevxxGTeunE,4772
477
- orionis-0.366.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
478
- orionis-0.366.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
479
- orionis-0.366.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
480
- orionis-0.366.0.dist-info/RECORD,,
481
+ orionis-0.368.0.dist-info/METADATA,sha256=V0XIIl9ESUfqKQdGbYonTDHTPRrl0OA8Y540Y1BUBS4,4772
482
+ orionis-0.368.0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
483
+ orionis-0.368.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
484
+ orionis-0.368.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
485
+ orionis-0.368.0.dist-info/RECORD,,