orionis 0.631.0__py3-none-any.whl → 0.633.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.
@@ -23,6 +23,7 @@ from orionis.foundation.config.startup import Configuration
23
23
  from orionis.foundation.config.testing.entities.testing import Testing
24
24
  from orionis.foundation.contracts.application import IApplication
25
25
  from orionis.foundation.exceptions import OrionisTypeError, OrionisRuntimeError, OrionisValueError
26
+ from orionis.services.environment.env import Env
26
27
  from orionis.services.log.contracts.log_service import ILogger
27
28
  from orionis.support.wrapper.dataclass import DataClass
28
29
 
@@ -112,6 +113,12 @@ class Application(Container, IApplication):
112
113
  boot status to False until explicitly booted via the create() method.
113
114
  """
114
115
 
116
+ # Check if the virtual environment is activated.
117
+ if not Env.isVirtual():
118
+ raise RuntimeError(
119
+ "You must activate the virtual environment to use the Orionis Framework correctly."
120
+ )
121
+
115
122
  # Initialize base container with application paths
116
123
  super().__init__()
117
124
 
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.631.0"
8
+ VERSION = "0.633.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -91,4 +91,43 @@ class Env(IEnv):
91
91
  dotenv = DotEnv()
92
92
 
93
93
  # Return all environment variables as a dictionary
94
- return dotenv.all()
94
+ return dotenv.all()
95
+
96
+ @staticmethod
97
+ def isVirtual() -> bool:
98
+ """
99
+ Determine if the current Python interpreter is running inside a virtual environment.
100
+
101
+ Returns
102
+ -------
103
+ bool
104
+ True if running inside a virtual environment, False otherwise.
105
+
106
+ Notes
107
+ -----
108
+ This method checks for the presence of common virtual environment indicators:
109
+ - The 'VIRTUAL_ENV' environment variable.
110
+ - The presence of 'pyvenv.cfg' in the parent directories of the Python executable.
111
+ - Differences between sys.prefix and sys.base_prefix (for venv and virtualenv).
112
+
113
+ This approach works for most virtual environment tools, including venv and virtualenv.
114
+ """
115
+ import sys
116
+ import os
117
+ from pathlib import Path
118
+
119
+ # Check for 'VIRTUAL_ENV' environment variable (set by virtualenv)
120
+ if 'VIRTUAL_ENV' in os.environ:
121
+ return True
122
+
123
+ # Check for 'pyvenv.cfg' in the executable's parent directories (set by venv)
124
+ executable = Path(sys.executable).resolve()
125
+ for parent in executable.parents:
126
+ if (parent / 'pyvenv.cfg').exists():
127
+ return True
128
+
129
+ # Compare sys.prefix and sys.base_prefix (works for venv and virtualenv)
130
+ if hasattr(sys, 'base_prefix') and sys.prefix != sys.base_prefix:
131
+ return True
132
+
133
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.631.0
3
+ Version: 0.633.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
@@ -103,7 +103,7 @@ orionis/failure/contracts/handler.py,sha256=AeJfkJfD3hTkOIYAtADq6GnQfq-qWgDfUc7b
103
103
  orionis/failure/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
104
  orionis/failure/entities/throwable.py,sha256=1zD-awcuAyEtlR-L7V7ZIfPSF4GpXkf-neL5sXul7dc,1240
105
105
  orionis/foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
- orionis/foundation/application.py,sha256=3-yuc7gxDUgpTj4knVpyePvTHQ0EYJgRZ3-ri8-ALLA,90401
106
+ orionis/foundation/application.py,sha256=oKhREI_LCOMBLdcPpfyBoAmYUolgO3aTVJ7umZ8xH4g,90693
107
107
  orionis/foundation/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  orionis/foundation/config/startup.py,sha256=btqvryeIf9lLNQ9fBff7bJMrfraEY8qrWi4y_5YAR0Q,9681
109
109
  orionis/foundation/config/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -216,7 +216,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
216
216
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
217
217
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
218
218
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
219
- orionis/metadata/framework.py,sha256=8WuxcQ0_lA18cThdYtXEUKgdwqFxUU7csC25Dk3eV7M,4089
219
+ orionis/metadata/framework.py,sha256=VxFpHj_VSSMXTFRCA4lpQyLruUXSmYA8AP6dflE5Ad8,4089
220
220
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
221
221
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
222
222
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -227,7 +227,7 @@ orionis/services/asynchrony/exceptions/__init__.py,sha256=LXjn7TFOVBaHbPFtV87hZ3
227
227
  orionis/services/asynchrony/exceptions/asynchrony.py,sha256=2MbqDBA5uGtnlXSmJAs6-1Lb4b8cHDXCKrnyRyucby0,407
228
228
  orionis/services/encrypter/encrypter.py,sha256=iOR8_rgyye_Mdlp9OY9Zs9UlnA4sfWvItiDWP_7Q4Vg,4073
229
229
  orionis/services/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
230
- orionis/services/environment/env.py,sha256=09poYYjI3lOEV3TuHh3JA8M8sfKN-lVIO4SKOmt6d_E,2845
230
+ orionis/services/environment/env.py,sha256=IfD4JJY2brBtIyqR6xtqJTOUcrvt4x0tuCC8m5DEepw,4280
231
231
  orionis/services/environment/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
232
232
  orionis/services/environment/contracts/caster.py,sha256=OPi82zrvnvVSoOuDfZ89JTYd7cmfW4wSJejTW1azDsc,1180
233
233
  orionis/services/environment/contracts/env.py,sha256=ozdYs3TkOsowPUrXSPEvm6mjoxYLWskliraQWh-WW4o,2122
@@ -403,8 +403,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
403
403
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
404
404
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
405
405
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
406
- orionis-0.631.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
- orionis-0.631.0.dist-info/METADATA,sha256=SmDnopPaeynF5MJ8HlS13MT7TDsPlqKbPcri_KAP_bQ,4772
408
- orionis-0.631.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
- orionis-0.631.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
- orionis-0.631.0.dist-info/RECORD,,
406
+ orionis-0.633.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
407
+ orionis-0.633.0.dist-info/METADATA,sha256=rhPCFP5JWSyLZfrwv-PpSAvYg-H16Sn6h6ifnMLq_i4,4772
408
+ orionis-0.633.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
409
+ orionis-0.633.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
410
+ orionis-0.633.0.dist-info/RECORD,,