orionis 0.152.0__py3-none-any.whl → 0.155.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.152.0"
8
+ VERSION = "0.155.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -150,12 +150,14 @@ class Application(metaclass=SingletonMeta):
150
150
  provider: IServiceProvider = service(app=self._container)
151
151
  provider.register()
152
152
 
153
- # If the provider has a boot method, execute it (sync or async)
154
153
  if hasattr(provider, 'boot') and callable(provider.boot):
155
- if inspect.iscoroutinefunction(provider.boot):
156
- await provider.boot()
157
- else:
158
- provider.boot()
154
+ try:
155
+ if inspect.iscoroutinefunction(provider.boot):
156
+ await provider.boot()
157
+ else:
158
+ provider.boot()
159
+ except Exception as e:
160
+ raise RuntimeError(f"Error booting service provider {service.__name__}: {e}") from e
159
161
 
160
162
  def _bootstrapping(self) -> None:
161
163
  """
@@ -184,71 +186,48 @@ class Application(metaclass=SingletonMeta):
184
186
  for command, data_command in self._commands.items():
185
187
  self._container.transient(data_command.get('signature'), data_command.get('concrete'))
186
188
 
189
+ @contextmanager
190
+ def app_context():
191
+ """
192
+ Context manager for creating an instance of the Orionis application.
187
193
 
194
+ This function initializes the Orionis application with a new container,
195
+ ensuring that the application is properly set up before use.
188
196
 
197
+ Yields
198
+ ------
199
+ Application
200
+ The initialized Orionis application instance.
189
201
 
202
+ Raises
203
+ ------
204
+ RuntimeError
205
+ If the application has not been properly initialized.
206
+ """
207
+ try:
208
+ yield Application.getInstance()
209
+ finally:
210
+ pass
190
211
 
212
+ def app_booted():
213
+ """
214
+ Check if the application has been booted.
191
215
 
216
+ Returns:
217
+ bool: True if the application has been booted, False otherwise.
218
+ """
219
+ return Application.isRunning()
192
220
 
221
+ def orionis():
222
+ """
223
+ Creates a new instance of the Orionis application.
193
224
 
225
+ Returns
226
+ -------
227
+ Application
228
+ A new instance of the Orionis application.
229
+ """
230
+ if Application.isRunning():
231
+ Application.destroy()
194
232
 
195
-
196
- # @contextmanager
197
- # def app_context():
198
- # """
199
- # Context manager for creating an instance of the Orionis application.
200
-
201
- # This function initializes the Orionis application with a new container,
202
- # ensuring that the application is properly set up before use.
203
-
204
- # Yields
205
- # ------
206
- # Application
207
- # The initialized Orionis application instance.
208
-
209
- # Raises
210
- # ------
211
- # RuntimeError
212
- # If the application has not been properly initialized.
213
- # """
214
- # try:
215
-
216
- # # Check if the application has been booted
217
- # if not Application.booted:
218
- # app = Application(Container()).boot()
219
- # else:
220
- # app = Application.getCurrentInstance()
221
-
222
- # # Yield the application instance
223
- # yield app
224
-
225
- # finally:
226
-
227
- # # Close Context Manager
228
- # pass
229
-
230
- # def app_booted():
231
- # """
232
- # Check if the application has been booted.
233
-
234
- # Returns:
235
- # bool: True if the application has been booted, False otherwise.
236
- # """
237
- # return Application.booted
238
-
239
- # def orionis():
240
- # """
241
- # Creates a new instance of the Orionis application.
242
-
243
- # Ensures that any existing singleton instance of `Application` is removed before
244
- # creating a fresh instance. It resets the singleton instances stored in `SingletonMeta`
245
- # and `Container`.
246
-
247
- # Returns
248
- # -------
249
- # Application
250
- # A new instance of the Orionis application.
251
- # """
252
- # Application.reset()
253
-
254
- # return Application()
233
+ return Application()
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.152.0
3
+ Version: 0.155.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=oXY5UYvtalP996h7z5iaEc7z5b1hyFWXrLPrvtoxWcU,1368
3
- orionis/framework.py,sha256=MYPzrjBwVhUN9eExAGSseZMpUYhclDbnww_DG3Jt940,1387
3
+ orionis/framework.py,sha256=5G-6LKYFz0VpCjKzsJfB-rR4z78RIvNiXTsOLO16_WE,1387
4
4
  orionis/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/installer/manager.py,sha256=UfUvHOCqcj6YKuwSS6pmhxRXUNGaMWseZNXBZybKLTk,3143
6
6
  orionis/installer/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -12,7 +12,7 @@ orionis/installer/output/output.py,sha256=eA_3yPUc50RwB829IgUzfipkawCIOIRqQlXuUw
12
12
  orionis/installer/setup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  orionis/installer/setup/setup.py,sha256=zAZDelFwieZ9HbR_mSgvW9-gI--Zzu__6SZWWw4VEE8,6967
14
14
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- orionis/luminate/application.py,sha256=qXoi6H32IdfFwDV85oRnaFvlVQft8viYo82FVSrYbgE,8294
15
+ orionis/luminate/application.py,sha256=eKbqYtJcRzD_1eipvkyCuk-N83m7Ec_Vd63HrMABOUA,7865
16
16
  orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  orionis/luminate/config/app.py,sha256=7teuVPuaV2ao0M5Bv-jhSgjEwb9DtVwde2saTRmYru4,1737
18
18
  orionis/luminate/config/auth.py,sha256=CG8F0pfVjKz4DY3d1Wi7gscdhnp4TT-Q8SJ2sdsHh18,523
@@ -43,6 +43,7 @@ orionis/luminate/console/output/console.py,sha256=URqrEHhsgWk2gOb4G13rCri40uMsih
43
43
  orionis/luminate/console/output/executor.py,sha256=91722rNiAsKpuq5QYiI7Aqw_7ccmn0DS9KYQrZt0TOs,3369
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
+ orionis/luminate/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
47
  orionis/luminate/container/container.py,sha256=Q_COU9QHshBH1XJ3OKEm3RTKSaLE9zs_gmNgson0tx0,18415
47
48
  orionis/luminate/container/container_integrity.py,sha256=mh0QxesWpu4hNBSkGgXYf0BICoB3D-nowD9s436JibU,7935
48
49
  orionis/luminate/container/exception.py,sha256=ap1SqYEjQEEHXJJTNmL7V1jrmRjgT5_7geZ95MYkhMA,1691
@@ -180,9 +181,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
180
181
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
182
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
182
183
  tests/tools/test_reflection.py,sha256=bhLQ7VGVod4B8sv-rW9AjnOumvaBVsoxieA3sdoM2yM,5244
183
- orionis-0.152.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
184
- orionis-0.152.0.dist-info/METADATA,sha256=M_3Tr1hfiiLS9nX4cBIqtsCVIgesAqKNe70t1rq-O9g,2970
185
- orionis-0.152.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
186
- orionis-0.152.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
187
- orionis-0.152.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
188
- orionis-0.152.0.dist-info/RECORD,,
184
+ orionis-0.155.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
185
+ orionis-0.155.0.dist-info/METADATA,sha256=MHkHMOABRHW_3pBQwDiJ1Ex8lHS_IgZm6XxPzQFjk7Q,2970
186
+ orionis-0.155.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
187
+ orionis-0.155.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
188
+ orionis-0.155.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
189
+ orionis-0.155.0.dist-info/RECORD,,