orionis 0.86.0__py3-none-any.whl → 0.90.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.86.0"
8
+ VERSION = "0.90.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,58 +1,35 @@
1
+ from contextlib import contextmanager
1
2
  from orionis.luminate.app import Application
3
+ from orionis.luminate.container.container import Container
2
4
 
3
- class AppContext:
5
+ @contextmanager
6
+ def app_context():
4
7
  """
5
8
  Context manager for resolving dependencies within a valid Orionis application context.
6
9
 
7
- This class ensures that Orionis is properly initialized before resolving dependencies,
10
+ This function ensures that Orionis is properly initialized before resolving dependencies,
8
11
  similar to how Laravel’s `app()` helper works.
9
12
 
10
- Methods
11
- -------
12
- __enter__()
13
- Validates the application state and provides access to the service container.
14
- __exit__(exc_type, exc_val, exc_tb)
15
- Ensures exceptions propagate naturally.
16
- """
17
-
18
- def __enter__(self):
19
- """
20
- Validates that the Orionis application is booted before allowing access to the container.
21
-
22
- Returns
23
- -------
24
- Container
25
- The application’s IoC container instance.
26
-
27
- Raises
28
- ------
29
- RuntimeError
30
- If the application has not been properly initialized.
31
- """
32
- app = Application()
33
- if not app.isBooted():
34
- raise RuntimeError(
35
- "Error: Not running within a valid Orionis Framework context. "
36
- "Ensure that the Orionis application is correctly initialized."
37
- )
38
- return app
13
+ Yields
14
+ ------
15
+ Application
16
+ The initialized Orionis application instance.
39
17
 
40
- def __exit__(self, exc_type, exc_val, exc_tb):
41
- """
42
- Allows exceptions to propagate naturally.
43
-
44
- Parameters
45
- ----------
46
- exc_type : type
47
- The exception type, if an error occurred.
48
- exc_val : Exception
49
- The exception instance, if an error occurred.
50
- exc_tb : traceback
51
- The traceback object associated with the exception, if an error occurred.
52
-
53
- Returns
54
- -------
55
- bool
56
- Always returns False to ensure exceptions are not suppressed.
57
- """
58
- return False
18
+ Raises
19
+ ------
20
+ RuntimeError
21
+ If the application has not been properly initialized.
22
+ """
23
+ container = Container()
24
+ app = Application(container)
25
+
26
+ if not app.isBooted():
27
+ raise RuntimeError(
28
+ "Error: Not running within a valid Orionis Framework context. "
29
+ "Ensure that the Orionis application is correctly initialized."
30
+ )
31
+
32
+ try:
33
+ yield app
34
+ finally:
35
+ pass
@@ -1,4 +1,4 @@
1
- from orionis.luminate.app_context import AppContext
1
+ from orionis.luminate.app_context import app_context
2
2
  from orionis.luminate.console.base.command import BaseCommand
3
3
  from orionis.luminate.console.exceptions.cli_exception import CLIOrionisRuntimeError
4
4
 
@@ -35,7 +35,7 @@ class HelpCommand(BaseCommand):
35
35
  self.textSuccessBold(" (CLI Interpreter) Available Commands: ")
36
36
 
37
37
  # Fetch the commands from the container IoC
38
- with AppContext() as app:
38
+ with app_context() as app:
39
39
 
40
40
  # Get the list of commands from the container
41
41
  commands : dict = app._commands
@@ -1,5 +1,4 @@
1
1
  import importlib
2
- from orionis.luminate.app_context import AppContext
3
2
  from orionis.luminate.console.base.command import BaseCommand
4
3
  from orionis.luminate.console.exceptions.cli_exception import CLIOrionisRuntimeError
5
4
  from orionis.luminate.console.tasks.scheduler import Schedule
@@ -8,8 +8,8 @@ from apscheduler.schedulers.background import BackgroundScheduler
8
8
  from apscheduler.triggers.cron import CronTrigger
9
9
  from apscheduler.triggers.interval import IntervalTrigger
10
10
  from orionis.contracts.console.tasks.i_schedule import ISchedule
11
- from orionis.luminate.app_context import AppContext
12
11
  from orionis.luminate.console.exceptions.cli_exception import CLIOrionisScheduleException
12
+ from orionis.luminate.facades.commands.commands_facade import Command
13
13
 
14
14
  class Schedule(ISchedule):
15
15
  """
@@ -67,8 +67,7 @@ class Schedule(ISchedule):
67
67
  """
68
68
  def func():
69
69
  try:
70
- with AppContext() as app:
71
- app.container.makeCommand(signature, vars, *args, **kwargs)
70
+ Command.call(signature, vars, *args, **kwargs)
72
71
  finally:
73
72
  if not self.scheduler.get_jobs():
74
73
  self.wait = False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.86.0
3
+ Version: 0.90.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
@@ -1,6 +1,6 @@
1
1
  orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  orionis/cli_manager.py,sha256=0bM-hABXJSoPGuvEgnqeaj9qcLP8VjTQ3z9Mb0TSEUI,1381
3
- orionis/framework.py,sha256=W6zzzJJ4OqVNSDkPBidOteh4zx_VSgfp7tAm-HcHZE8,1386
3
+ orionis/framework.py,sha256=Z1Sydsk8EyOluZovVk03mk5pBuEWeOCq7OB4ueAhXaY,1386
4
4
  orionis/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/contracts/bootstrap/i_command_bootstrapper.py,sha256=cfpYWSlNhOY1q_C9o0H7F381OoM0Oh0qaeqP-c85nzk,2457
6
6
  orionis/contracts/bootstrap/i_config_bootstrapper.py,sha256=d2TXT74H2fCBbzWgrt9-ZG11S_H_YPQOEcJoIOrsgb0,4462
@@ -61,7 +61,7 @@ orionis/installer/installer_output.py,sha256=LeKxzuXpnHOKbKpUtx3tMGkCi2bGcPV1VNn
61
61
  orionis/installer/installer_setup.py,sha256=c2HtVklSa-2_-YVonc7fwtoK-RTDqBS2Ybvbekgfqtc,6970
62
62
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  orionis/luminate/app.py,sha256=8jgfMgcf01PsGBV1YaIUR8axKXkX7MtHNKJI0YEKWWc,11629
64
- orionis/luminate/app_context.py,sha256=XREVkOHU6aP8UB2daA2QbFcOCB8HRmcGXjVbrlW1AHQ,1827
64
+ orionis/luminate/app_context.py,sha256=se2xpsGoy_drcuOROC7OHaIAN5Yd0kbm5V1zzsxxyQc,996
65
65
  orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  orionis/luminate/bootstrap/command_bootstrapper.py,sha256=JJkWWOS2R2Zg7mC7-VMtZ0wAgxlegMkdnqudpbAjxwk,6925
67
67
  orionis/luminate/bootstrap/config_bootstrapper.py,sha256=Gw83UtPAOggwzqmz062JfJcpIfmZvmIQyZJfgVFiIcQ,7474
@@ -87,8 +87,8 @@ orionis/luminate/console/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
87
87
  orionis/luminate/console/base/command.py,sha256=YGHd5xVYILcNhQumi74IRnzvagvjufEO2Bx1CwHRToY,12544
88
88
  orionis/luminate/console/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
89
  orionis/luminate/console/commands/cache_clear.py,sha256=KyXVSwtLaV1O1cTEkNzX9czCwEoeQlAjiT0jUFMO8iE,2684
90
- orionis/luminate/console/commands/help.py,sha256=wpJz1f-elK-q4D3e1vG6s-gCbJDCl9Oxas2gH_-Ojv0,2286
91
- orionis/luminate/console/commands/schedule_work.py,sha256=r9Q-CgX1N_R1qcy0gQuUS6P7ZmAcZ6SALVnJUZmWnQg,1981
90
+ orionis/luminate/console/commands/help.py,sha256=8_LOTuiZvA8HToKP5qBoN7rWlEo3T0Qik7-f3fyrTgo,2288
91
+ orionis/luminate/console/commands/schedule_work.py,sha256=VHXmcW02Gewo2UjiYpc528fjYDptDu73MBt-hnVb_AE,1928
92
92
  orionis/luminate/console/commands/tests.py,sha256=Z7e6aM5Vu8C7R8iC8sJgUYVN9aJgtVMkqjUEFxPq91o,1281
93
93
  orionis/luminate/console/commands/version.py,sha256=llVPK6ELtf8dIdPvLbybrtipWwZkzV0EXc9ShL-C-GY,1140
94
94
  orionis/luminate/console/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -99,7 +99,7 @@ orionis/luminate/console/output/executor.py,sha256=0_6AGM1vE5umdpVVogQUE5eW9cu5U
99
99
  orionis/luminate/console/output/progress_bar.py,sha256=ssi8Drryr-shl7OxweTgGOhvRvAlCVxjBGm1L1qyO84,3089
100
100
  orionis/luminate/console/output/styles.py,sha256=2e1_FJdNpKaVqmdlCx-udzTleH_6uEFE9_TjH7T1ZUk,3696
101
101
  orionis/luminate/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
- orionis/luminate/console/tasks/scheduler.py,sha256=zt4p2VGUYGGrG2-E-MxyheKjBqGDJB2c0irULDsBgIw,22678
102
+ orionis/luminate/console/tasks/scheduler.py,sha256=5_99tg3vGbKYipTnhSoM_fPPu7AYvMXb7khZ4wRRf_Q,22636
103
103
  orionis/luminate/container/container.py,sha256=Ruyhs5OAiO6nMFhGDm7TNQD4qqFO0lh_phqUFDit_bE,16429
104
104
  orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
105
105
  orionis/luminate/container/types.py,sha256=BDcXN0__voRNHZ5Gr5dF0sWIYAQyNk4TxAwILBWyDAA,1735
@@ -160,9 +160,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
161
161
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
162
162
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
163
- orionis-0.86.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
164
- orionis-0.86.0.dist-info/METADATA,sha256=K4p9kNU1jpYbrSYRxqYg9BRjzb3uPtlGxuN4YnbZJr0,2978
165
- orionis-0.86.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
166
- orionis-0.86.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
167
- orionis-0.86.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
168
- orionis-0.86.0.dist-info/RECORD,,
163
+ orionis-0.90.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
164
+ orionis-0.90.0.dist-info/METADATA,sha256=Lr6WtsT4DsU7UdUfU7Z45UFvDkPQjNmQfPg_lSGNuhM,2978
165
+ orionis-0.90.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
166
+ orionis-0.90.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
167
+ orionis-0.90.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
168
+ orionis-0.90.0.dist-info/RECORD,,