orionis 0.16.0__py3-none-any.whl → 0.18.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.16.0"
8
+ VERSION = "0.18.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -2,7 +2,7 @@ import ast
2
2
  import importlib
3
3
  import os
4
4
  from orionis.luminate.bootstrap.config.register import Register
5
- from orionis.luminate.contracts.bootstrap.bootstrapper_interface import IBootstrapper
5
+ from orionis.luminate.contracts.bootstrap.config.bootstrapper_interface import IBootstrapper
6
6
 
7
7
  class Bootstrapper(IBootstrapper):
8
8
  """
@@ -23,10 +23,10 @@ class Bootstrapper(IBootstrapper):
23
23
  __init__(register: Register) -> None
24
24
  Initializes the `Bootstrapper` with a `Register` instance.
25
25
 
26
- findClasses(file_path: str) -> List[str]
26
+ _findClasses(file_path: str) -> List[str]
27
27
  Parses a Python file to extract and return all defined class names.
28
28
 
29
- autoload(directory: str) -> None
29
+ _autoload(directory: str) -> None
30
30
  Scans a directory for Python files, imports them, finds configuration classes,
31
31
  and registers them using the `Register` instance.
32
32
  """
@@ -41,8 +41,9 @@ class Bootstrapper(IBootstrapper):
41
41
  An instance of the `Register` class used to register configuration classes.
42
42
  """
43
43
  self.register = register
44
+ self._autoload()
44
45
 
45
- def findClasses(self, file_path: str):
46
+ def _definitions(self, file_path: str):
46
47
  """
47
48
  Parses a Python file to extract and return all defined class names.
48
49
 
@@ -70,7 +71,7 @@ class Bootstrapper(IBootstrapper):
70
71
 
71
72
  return classes
72
73
 
73
- def autoload(self, directory: str = 'config') -> None:
74
+ def _autoload(self, directory: str = 'config') -> None:
74
75
  """
75
76
  Automatically registers configuration classes found in a given directory.
76
77
 
@@ -97,7 +98,7 @@ class Bootstrapper(IBootstrapper):
97
98
  if file.endswith(".py") and file != "__init__.py":
98
99
  file_path = os.path.join(root, file)
99
100
  # Get the class names defined in the file
100
- classes = self.findClasses(file_path)
101
+ classes = self._definitions(file_path)
101
102
 
102
103
  if classes:
103
104
  for class_name in classes:
@@ -1,6 +1,6 @@
1
1
  from typing import Any
2
2
  from dataclasses import asdict
3
- from orionis.luminate.contracts.bootstrap.parser_interface import IParser
3
+ from orionis.luminate.contracts.bootstrap.config.parser_interface import IParser
4
4
 
5
5
  class Parser(IParser):
6
6
  """
@@ -1,7 +1,6 @@
1
1
  from orionis.luminate.bootstrap.config.parser import Parser
2
- from orionis.luminate.config.sections import SECTIONS
3
2
  from orionis.luminate.container.container import Container
4
- from orionis.luminate.contracts.bootstrap.register_interface import IRegister
3
+ from orionis.luminate.contracts.bootstrap.config.register_interface import IRegister
5
4
  from orionis.luminate.contracts.config.config_interface import IConfig
6
5
  from orionis.luminate.tools.reflection import Reflection
7
6
 
@@ -12,25 +11,20 @@ class Register(IRegister):
12
11
  This class ensures that only valid configuration classes are registered
13
12
  while enforcing structure and type safety.
14
13
 
15
- Attributes
16
- ----------
17
- cache_config : CacheConfig
18
- An instance of `CacheConfig` used to store registered configurations.
19
-
20
14
  Methods
21
15
  -------
22
16
  config(config_class: type) -> type
23
17
  Registers a configuration class and ensures it meets the necessary criteria.
24
18
  """
25
19
 
26
- def __init__(self, container: Container) -> None:
20
+ def __init__(self, container = Container()) -> None:
27
21
  """
28
22
  Initializes the Register instance with a cache configuration.
29
23
 
30
24
  Parameters
31
25
  ----------
32
- cache : CacheConfig, optional
33
- The cache configuration instance to be used (default is a new instance of `CacheConfig`).
26
+ container : Container
27
+ The container instance to be used for configuration registration.
34
28
  """
35
29
  self.container = container
36
30
 
@@ -60,21 +54,17 @@ class Register(IRegister):
60
54
  If `config_class` does not have a `config` attribute or is already registered.
61
55
  """
62
56
 
57
+ # Validate input type
63
58
  if not isinstance(config_class, type):
64
59
  raise TypeError(f"Expected a class, but got {type(config_class).__name__}.")
65
60
 
61
+ # Validate config attribute
66
62
  if not hasattr(config_class, 'config'):
67
63
  raise ValueError(f"Class {config_class.__name__} must have a 'config' attribute.")
68
64
 
69
65
  # Extract module name
70
66
  section = Reflection(config_class).getFileName(remove_extension=True)
71
67
 
72
- # Validate section
73
- if section not in SECTIONS:
74
- raise ValueError(
75
- f"Invalid configuration section '{section}'. Allowed sections: {SECTIONS}"
76
- )
77
-
78
68
  # Validate inheritance
79
69
  if not issubclass(config_class, IConfig):
80
70
  raise TypeError(f"Class {config_class.__name__} must inherit from 'IConfig'.")
@@ -21,7 +21,7 @@ class IBootstrapper(ABC):
21
21
  """
22
22
 
23
23
  @abstractmethod
24
- def findClasses(self, file_path: str):
24
+ def _definitions(self, file_path: str):
25
25
  """
26
26
  Parses a Python file to extract and return all defined class names.
27
27
 
@@ -42,7 +42,7 @@ class IBootstrapper(ABC):
42
42
  pass
43
43
 
44
44
  @abstractmethod
45
- def autoload(self, directory: str) -> None:
45
+ def _autoload(self, directory: str) -> None:
46
46
  """
47
47
  Automatically registers configuration classes found in a given directory.
48
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: orionis
3
- Version: 0.16.0
3
+ Version: 0.18.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,13 +1,13 @@
1
1
  orionis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  orionis/cli_manager.py,sha256=9wNVJxB0HyqUbNesUvkwlsqTyUbZwK6R46iVLE5WVBQ,1715
3
- orionis/framework.py,sha256=0TP4bRIMq4W_zH3ffOzHCbsjIN5R36q7PJpyLPFW3nQ,1386
3
+ orionis/framework.py,sha256=4ilspd7nmKcBPyWZ0pNNOZeAA0sin3LpEsbO9vDCx6Y,1386
4
4
  orionis/luminate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  orionis/luminate/app.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  orionis/luminate/bootstrap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  orionis/luminate/bootstrap/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- orionis/luminate/bootstrap/config/bootstrapper.py,sha256=JFzNN5TN5nHQ-K5wW1zViTAR8abBbZ9DI2ZAWw0a-2g,4189
9
- orionis/luminate/bootstrap/config/parser.py,sha256=Ez8HsMdSMMZ_5a842ZCFjkSLqbIvUrKnXGxeVP92eRo,1943
10
- orionis/luminate/bootstrap/config/register.py,sha256=OI1M0dr_wQnfPiXhMZqhDFK1SZnTmRe_Q5_G4S8rnJs,3134
8
+ orionis/luminate/bootstrap/config/bootstrapper.py,sha256=R1ixec362o-Td-kNSvi-0ylVqspFWJq6L6IHYzWHPmg,4227
9
+ orionis/luminate/bootstrap/config/parser.py,sha256=Ay8dh3aax9xhVgeLSHT71ubtZJiKAJAP85dLFF7djyA,1950
10
+ orionis/luminate/bootstrap/config/register.py,sha256=O_7-LhIJaZGzQJYShoTVTtjG90QM6dTYLuQ5QKeAbUQ,2775
11
11
  orionis/luminate/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  orionis/luminate/cache/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  orionis/luminate/cache/app/config.py,sha256=4V-E-jkBurc0imqCZedsEO3KmKz9hfK-XQjuBVbmHRg,2777
@@ -15,7 +15,6 @@ orionis/luminate/cache/console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
15
15
  orionis/luminate/cache/console/commands.py,sha256=hDwGT4DhMnV4LM35CX7L-E5c_cCHn4TLVkgdXvJ3wFg,3181
16
16
  orionis/luminate/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  orionis/luminate/config/environment.py,sha256=QhiyZNnngh9Ol-SPIHIep4D3YCzVMxoMgCXeJjxV9FU,3301
18
- orionis/luminate/config/sections.py,sha256=v-P3bJB62v5nIdKtbscP9d3dI2vwr4R_-BBE5LhOqg8,1483
19
18
  orionis/luminate/config/dataclass/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
19
  orionis/luminate/config/dataclass/app.py,sha256=7teuVPuaV2ao0M5Bv-jhSgjEwb9DtVwde2saTRmYru4,1737
21
20
  orionis/luminate/config/dataclass/auth.py,sha256=CG8F0pfVjKz4DY3d1Wi7gscdhnp4TT-Q8SJ2sdsHh18,523
@@ -58,9 +57,9 @@ orionis/luminate/container/container.py,sha256=rgUQ1fJslFR-0nxzpubAGEMXAiZZlVd_T
58
57
  orionis/luminate/container/exception.py,sha256=Tf7KdfbEtr0YldhZ1WrKfkBlI5W_KvZO61xWAGFdF0A,1156
59
58
  orionis/luminate/container/types.py,sha256=PbPNOJ8e4SGzCmu-zOmCQmDzt1b9I73v3fw_xzLq9RU,932
60
59
  orionis/luminate/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
- orionis/luminate/contracts/bootstrap/bootstrapper_interface.py,sha256=sTJAlw0yja-fomUvDsS_7VsvrA8yhIBIcDyvG5URx7E,2249
62
- orionis/luminate/contracts/bootstrap/parser_interface.py,sha256=7DLnp7yB7edayVkSm-piTi8JSf0QKaYYI82qDZudgM0,1641
63
- orionis/luminate/contracts/bootstrap/register_interface.py,sha256=600rNNM9SaYlVuDTSirfNpwEVHODdu_ZMj_dOx_vJkU,1506
60
+ orionis/luminate/contracts/bootstrap/config/bootstrapper_interface.py,sha256=De6nKQcZpN1dWsubXWUO229ZH4IbCoUaGtP5HOUw2Ps,2251
61
+ orionis/luminate/contracts/bootstrap/config/parser_interface.py,sha256=7DLnp7yB7edayVkSm-piTi8JSf0QKaYYI82qDZudgM0,1641
62
+ orionis/luminate/contracts/bootstrap/config/register_interface.py,sha256=600rNNM9SaYlVuDTSirfNpwEVHODdu_ZMj_dOx_vJkU,1506
64
63
  orionis/luminate/contracts/cache/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
64
  orionis/luminate/contracts/cache/cache_commands_interface.py,sha256=NhJAh2OZHXKMwbJ8nOU4IFJRZpuJNmfN9rtnpbCnuOo,1936
66
65
  orionis/luminate/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -141,9 +140,9 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
140
  tests/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
142
141
  tests/tools/class_example.py,sha256=dIPD997Y15n6WmKhWoOFSwEldRm9MdOHTZZ49eF1p3c,1056
143
142
  tests/tools/test_reflection.py,sha256=dNN5p_xAosyEf0ddAElmmmTfhcTtBd4zBNl7qzgnsc0,5242
144
- orionis-0.16.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
145
- orionis-0.16.0.dist-info/METADATA,sha256=6GtLcWYAiD2VjSrYod3dexuxLn0X5_Wg6i9dKUJ3Iik,2978
146
- orionis-0.16.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
147
- orionis-0.16.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
148
- orionis-0.16.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
149
- orionis-0.16.0.dist-info/RECORD,,
143
+ orionis-0.18.0.dist-info/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
144
+ orionis-0.18.0.dist-info/METADATA,sha256=WOpBgkK-eut-jkQFjgfeeMij6E4VOylykbK3H5SCzPY,2978
145
+ orionis-0.18.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
146
+ orionis-0.18.0.dist-info/entry_points.txt,sha256=eef1_CVewfokKjrGBynXa06KabSJYo7LlDKKIKvs1cM,53
147
+ orionis-0.18.0.dist-info/top_level.txt,sha256=2bdoHgyGZhOtLAXS6Om8OCTmL24dUMC_L1quMe_ETbk,14
148
+ orionis-0.18.0.dist-info/RECORD,,
@@ -1,37 +0,0 @@
1
- # ------------------------------------------------------------------------------
2
- # Authorized Configuration Sections for Bootstrapping
3
- # ------------------------------------------------------------------------------
4
- # This tuple defines the only allowed configuration sections that can be used
5
- # during the application's bootstrapping process.
6
- #
7
- # Each section represents a core component of the framework, ensuring that only
8
- # predefined and necessary configurations are loaded at startup. This prevents
9
- # unauthorized modifications or unintended settings from being injected.
10
- #
11
- # Sections:
12
- # - app : General application settings.
13
- # - auth : Authentication and authorization settings.
14
- # - cache : Configuration for caching mechanisms.
15
- # - cors : Cross-Origin Resource Sharing (CORS) policies.
16
- # - database : Database connection and ORM settings.
17
- # - filesystems: File storage configurations.
18
- # - logging : Logging and monitoring settings.
19
- # - mail : Email sending and SMTP configurations.
20
- # - queue : Queue system settings for background tasks.
21
- # - session : Session management configurations.
22
- #
23
- # Any configuration outside these sections will be ignored or rejected.
24
- # ------------------------------------------------------------------------------
25
-
26
- SECTIONS = (
27
- 'app',
28
- 'auth',
29
- 'cache',
30
- 'cors',
31
- 'database',
32
- 'filesystems',
33
- 'logging',
34
- 'mail',
35
- 'queue',
36
- 'session'
37
- )