orionis 0.663.0__py3-none-any.whl → 0.664.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.
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.663.0"
8
+ VERSION = "0.664.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.663.0
3
+ Version: 0.664.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
@@ -84,16 +84,6 @@ orionis/container/facades/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
84
84
  orionis/container/facades/facade.py,sha256=c9V4ywJCdux1oluzVc7ph_8-TY2Nc85k3_UeQSBkiQY,3674
85
85
  orionis/container/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
86
  orionis/container/providers/service_provider.py,sha256=OlqmBIkZSDZHJ_JZvwhNiMMrn-GzeIoCgR-HdsqGOVM,2385
87
- orionis/container/validators/__init__.py,sha256=iJ_cY8U0EkpnZOU4_LANGKHFkvHeV0vH5bjbYr1fdSg,609
88
- orionis/container/validators/implements.py,sha256=6q6abRSXxpByIGGb_C5P3qGkvyX5zogOceFt9DPzUdI,3110
89
- orionis/container/validators/is_abstract_class.py,sha256=vJqUPn610YZS0sEkV8c_gPZskIgWmFHjg3D3MF2OTs8,1141
90
- orionis/container/validators/is_callable.py,sha256=ZW-e3ljJGXbD9GUEfPNqVcyBbpVHFlfYaTf9rSmJmBk,824
91
- orionis/container/validators/is_concrete_class.py,sha256=CLStCMuf40amVLvg1x0utlUz64xJnp9guc8j50J95d8,1187
92
- orionis/container/validators/is_instance.py,sha256=IkpSyd81jTc3WnmQyrh6TmQb-4suD38h03ckhjfrI90,971
93
- orionis/container/validators/is_not_subclass.py,sha256=xq2NI-ZJjSAnq2C_tEOyncadY4i9vjj9Pa2MKVow3Ek,1149
94
- orionis/container/validators/is_subclass.py,sha256=4sBaGLoRs8nUhuWjlP0VJqyTwVHYqIVB8zXVN-bYnBI,1117
95
- orionis/container/validators/is_valid_alias.py,sha256=4uAYcq8xov7jZbXnpKpjNkxcZtlTNnL5RRctVPMwJes,1424
96
- orionis/container/validators/lifetime.py,sha256=IQ43fDNrxYHMlZH2zlYDJnlkLO_eS4U7Fs3UJgQBidI,1844
97
87
  orionis/failure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
88
  orionis/failure/catch.py,sha256=O6C_KsSPI-ZZb8upzwGagkJMhQ6FWX7J2q9BWweMgQE,3286
99
89
  orionis/failure/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -217,7 +207,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
217
207
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
218
208
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
219
209
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
- orionis/metadata/framework.py,sha256=0SXT6mJPx_cpwHycCwnheRoGpH0odIHXGOk8OeY37jo,4089
210
+ orionis/metadata/framework.py,sha256=H-AkUGADSlKFuauY2U4ZvjGmaIO5KKNP6NpvVciaXfU,4089
221
211
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
222
212
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
213
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -404,8 +394,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
404
394
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
395
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
406
396
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
407
- orionis-0.663.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
- orionis-0.663.0.dist-info/METADATA,sha256=7VlP3kWuATRSS3Ideqk4S5ixt_hHwbxaN7kvvpmvyoc,4772
409
- orionis-0.663.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
- orionis-0.663.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
- orionis-0.663.0.dist-info/RECORD,,
397
+ orionis-0.664.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
398
+ orionis-0.664.0.dist-info/METADATA,sha256=4gQujfxs0AkLeB_GuD6ohahj1ncWIVRTLa9t6aKOKAo,4772
399
+ orionis-0.664.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
400
+ orionis-0.664.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
401
+ orionis-0.664.0.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- from .implements import ImplementsAbstractMethods
2
- from .is_abstract_class import IsAbstractClass
3
- from .is_concrete_class import IsConcreteClass
4
- from .is_instance import IsInstance
5
- from .is_callable import IsCallable
6
- from .is_subclass import IsSubclass
7
- from .is_not_subclass import IsNotSubclass
8
- from .is_valid_alias import IsValidAlias
9
- from .lifetime import LifetimeValidator
10
-
11
- __all__ = [
12
- "ImplementsAbstractMethods",
13
- "IsAbstractClass",
14
- "IsConcreteClass",
15
- "IsInstance",
16
- "IsCallable",
17
- "IsSubclass",
18
- "IsNotSubclass",
19
- "IsValidAlias",
20
- "LifetimeValidator",
21
- ]
@@ -1,73 +0,0 @@
1
- from typing import Callable, Any
2
- from orionis.services.introspection.objects.types import Type
3
- from orionis.container.exceptions import OrionisContainerException
4
-
5
- class __ImplementsAbstractMethods:
6
- """
7
- Validator that ensures a concrete class or instance implements all abstract methods of an abstract class.
8
- """
9
-
10
- def __call__(
11
- self,
12
- *,
13
- abstract: Callable[..., Any] = None,
14
- concrete: Callable[..., Any] = None,
15
- instance: Any = None
16
- ) -> None:
17
- """
18
- Validates that a concrete class or instance implements all abstract methods defined in an abstract class.
19
-
20
- Parameters
21
- ----------
22
- abstract : Callable[..., Any]
23
- The abstract base class.
24
- concrete : Callable[..., Any], optional
25
- The class expected to implement the abstract methods.
26
- instance : Any, optional
27
- The instance expected to implement the abstract methods.
28
-
29
- Raises
30
- ------
31
- OrionisContainerException
32
- If any abstract method is not implemented.
33
- """
34
-
35
- # Validate that the abstract class is provided
36
- if abstract is None:
37
- raise OrionisContainerException("Abstract class must be provided for implementation check.")
38
-
39
- # Check if the abstract class has abstract methods
40
- abstract_methods = getattr(abstract, '__abstractmethods__', set())
41
- if not abstract_methods:
42
- raise OrionisContainerException(
43
- f"The abstract class '{abstract.__name__}' does not define any abstract methods. "
44
- "An abstract class must have at least one abstract method."
45
- )
46
-
47
- # Determine the target class or instance to check
48
- target = concrete if concrete is not None else instance
49
- if target is None:
50
- raise OrionisContainerException("Either concrete class or instance must be provided for implementation check.")
51
-
52
- # Validate that the target is a class or instance
53
- target_class = target if Type(target).isClass() else target.__class__
54
- target_name = target_class.__name__
55
- abstract_name = abstract.__name__
56
-
57
- # Check if the target class implements all abstract methods
58
- not_implemented = []
59
- for method in abstract_methods:
60
- expected_method = str(method).replace(f"_{abstract_name}", f"_{target_name}")
61
- if expected_method not in target_class.__dict__:
62
- not_implemented.append(method)
63
-
64
- # If any abstract methods are not implemented, raise an exception
65
- if not_implemented:
66
- formatted = "\n • " + "\n • ".join(not_implemented)
67
- raise OrionisContainerException(
68
- f"'{target_name}' does not implement the following abstract methods defined in '{abstract_name}':{formatted}\n"
69
- "Please ensure that all abstract methods are implemented."
70
- )
71
-
72
- # Exported singleton instance
73
- ImplementsAbstractMethods = __ImplementsAbstractMethods()
@@ -1,34 +0,0 @@
1
- from typing import Callable, Any
2
- from orionis.services.introspection.abstract.reflection import ReflectionAbstract
3
- from orionis.container.exceptions import OrionisContainerTypeError
4
-
5
- class __IsAbstractClass:
6
- """
7
- Validator that ensures a class is an abstract class.
8
- """
9
-
10
- def __call__(self, abstract: Callable[..., Any], lifetime: str) -> None:
11
- """
12
- Ensures that the provided class is an abstract class.
13
-
14
- Parameters
15
- ----------
16
- abstract : Callable[..., Any]
17
- The class intended to represent the abstract type.
18
- lifetime : str
19
- A string indicating the service lifetime, used in error messages.
20
-
21
- Raises
22
- ------
23
- OrionisContainerTypeError
24
- If the class is not abstract.
25
- """
26
- try:
27
- ReflectionAbstract.ensureIsAbstractClass(abstract)
28
- except Exception as e:
29
- raise OrionisContainerTypeError(
30
- f"Unexpected error registering {lifetime} service: {e}"
31
- ) from e
32
-
33
- # Exported singleton instance
34
- IsAbstractClass = __IsAbstractClass()
@@ -1,30 +0,0 @@
1
- from typing import Any
2
- from orionis.container.exceptions import OrionisContainerTypeError
3
-
4
- class __IsCallable:
5
- """
6
- Validator that checks if a value is callable.
7
- Can be used directly like a function: `IsCallable(value)`
8
- """
9
-
10
- def __call__(self, value: Any) -> None:
11
- """
12
- Ensures that the provided value is callable.
13
-
14
- Parameters
15
- ----------
16
- value : Any
17
- The value to check.
18
-
19
- Raises
20
- ------
21
- OrionisContainerTypeError
22
- If the value is not callable.
23
- """
24
- if not callable(value):
25
- raise OrionisContainerTypeError(
26
- f"Expected a callable type, but got {type(value).__name__} instead."
27
- )
28
-
29
- # Exported singleton instance
30
- IsCallable = __IsCallable()
@@ -1,34 +0,0 @@
1
- from typing import Callable, Any
2
- from orionis.services.introspection.concretes.reflection import ReflectionConcrete
3
- from orionis.container.exceptions import OrionisContainerTypeError
4
-
5
- class __IsConcreteClass:
6
- """
7
- Validator that ensures a class is a concrete (non-abstract) class.
8
- """
9
-
10
- def __call__(self, concrete: Callable[..., Any], lifetime: str) -> None:
11
- """
12
- Ensures that the provided class is a concrete (non-abstract) class.
13
-
14
- Parameters
15
- ----------
16
- concrete : Callable[..., Any]
17
- The class intended to represent the concrete implementation.
18
- lifetime : str
19
- A string indicating the service lifetime, used in error messages.
20
-
21
- Raises
22
- ------
23
- OrionisContainerTypeError
24
- If the class is abstract or invalid.
25
- """
26
- try:
27
- ReflectionConcrete.ensureIsConcreteClass(concrete)
28
- except Exception as e:
29
- raise OrionisContainerTypeError(
30
- f"Unexpected error registering {lifetime} service: {e}"
31
- ) from e
32
-
33
- # Exported singleton instance
34
- IsConcreteClass = __IsConcreteClass()
@@ -1,32 +0,0 @@
1
- from typing import Any
2
- from orionis.services.introspection.instances.reflection import ReflectionInstance
3
- from orionis.container.exceptions import OrionisContainerTypeError
4
-
5
- class __IsInstance:
6
- """
7
- Validator that ensures the provided object is a valid instance (not a class or abstract type).
8
- """
9
-
10
- def __call__(self, instance: Any) -> None:
11
- """
12
- Ensures that the provided object is a valid instance.
13
-
14
- Parameters
15
- ----------
16
- instance : Any
17
- The object to be validated.
18
-
19
- Raises
20
- ------
21
- OrionisContainerTypeError
22
- If the object is not a valid instance.
23
- """
24
- try:
25
- ReflectionInstance.ensureIsInstance(instance)
26
- except Exception as e:
27
- raise OrionisContainerTypeError(
28
- f"Error registering instance: {e}"
29
- ) from e
30
-
31
- # Exported singleton instance
32
- IsInstance = __IsInstance()
@@ -1,32 +0,0 @@
1
- from typing import Callable
2
- from orionis.container.exceptions import OrionisContainerException
3
-
4
- class __IsNotSubclass:
5
- """
6
- Validator that ensures a class is NOT a subclass of another class.
7
- """
8
-
9
- def __call__(self, abstract: Callable[..., any], concrete: Callable[..., any]) -> None:
10
- """
11
- Validates that the concrete class is NOT a subclass of the abstract class.
12
-
13
- Parameters
14
- ----------
15
- abstract : Callable[..., Any]
16
- The supposed base class or interface.
17
- concrete : Callable[..., Any]
18
- The implementation class to check.
19
-
20
- Raises
21
- ------
22
- OrionisContainerException
23
- If the concrete class IS a subclass of the abstract class.
24
- """
25
- if issubclass(concrete, abstract):
26
- raise OrionisContainerException(
27
- "The concrete class must NOT inherit from the provided abstract class. "
28
- "Please ensure that the concrete class is not a subclass of the specified abstract class."
29
- )
30
-
31
- # Exported singleton instance
32
- IsNotSubclass = __IsNotSubclass()
@@ -1,32 +0,0 @@
1
- from typing import Callable
2
- from orionis.container.exceptions import OrionisContainerException
3
-
4
- class __IsSubclass:
5
- """
6
- Validator that ensures a class is a subclass of a given abstract class.
7
- """
8
-
9
- def __call__(self, abstract: Callable[..., any], concrete: Callable[..., any]) -> None:
10
- """
11
- Validates that the concrete class is a subclass of the abstract class.
12
-
13
- Parameters
14
- ----------
15
- abstract : Callable[..., Any]
16
- The base or abstract class.
17
- concrete : Callable[..., Any]
18
- The class to verify.
19
-
20
- Raises
21
- ------
22
- OrionisContainerException
23
- If the concrete class is NOT a subclass of the abstract class.
24
- """
25
- if not issubclass(concrete, abstract):
26
- raise OrionisContainerException(
27
- "The concrete class must inherit from the provided abstract class. "
28
- "Please ensure that the concrete class is a subclass of the specified abstract class."
29
- )
30
-
31
- # Exported singleton instance
32
- IsSubclass = __IsSubclass()
@@ -1,42 +0,0 @@
1
- from typing import Any
2
- from orionis.container.exceptions import OrionisContainerTypeError
3
-
4
- class __IsValidAlias:
5
- """
6
- Validator that checks if a value is a valid alias string.
7
- """
8
-
9
- _INVALID_CHARS = set(' \t\n\r\x0b\x0c!@#$%^&*()[]{};:,/<>?\\|`~"\'')
10
-
11
- def __call__(self, value: Any) -> None:
12
- """
13
- Ensures that the provided value is a valid alias of type str and does not contain invalid characters.
14
-
15
- Parameters
16
- ----------
17
- value : Any
18
- The value to check.
19
-
20
- Raises
21
- ------
22
- OrionisContainerTypeError
23
- If the value is not of type str or contains invalid characters.
24
- """
25
- if value is None or value == "" or str(value).isspace():
26
- raise OrionisContainerTypeError(
27
- "Alias cannot be None, empty, or whitespace only."
28
- )
29
-
30
- if not isinstance(value, str):
31
- raise OrionisContainerTypeError(
32
- f"Expected a string type for alias, but got {type(value).__name__} instead."
33
- )
34
-
35
- if any(char in self._INVALID_CHARS for char in value):
36
- raise OrionisContainerTypeError(
37
- f"Alias '{value}' contains invalid characters. "
38
- "Aliases must not contain whitespace or special symbols."
39
- )
40
-
41
- # Exported singleton instance
42
- IsValidAlias = __IsValidAlias()
@@ -1,53 +0,0 @@
1
- from typing import Any, Union
2
- from orionis.container.enums.lifetimes import Lifetime
3
- from orionis.container.exceptions import OrionisContainerTypeError
4
-
5
- class __LifetimeValidator:
6
- """
7
- Validator that checks if a value is a valid lifetime and converts string representations
8
- to Lifetime enum values.
9
- """
10
-
11
- def __call__(self, lifetime: Union[str, Lifetime, Any]) -> Lifetime:
12
- """
13
- Validates and normalizes the provided lifetime value.
14
-
15
- Parameters
16
- ----------
17
- lifetime : Union[str, Lifetime, Any]
18
- The lifetime value to validate. Can be a Lifetime enum or a string
19
- representing a valid lifetime.
20
-
21
- Returns
22
- -------
23
- Lifetime
24
- The validated Lifetime enum value.
25
-
26
- Raises
27
- ------
28
- OrionisContainerTypeError
29
- If the value is not a valid Lifetime enum or string representation,
30
- or if the string doesn't match any valid Lifetime value.
31
- """
32
- # Already a Lifetime enum
33
- if isinstance(lifetime, Lifetime):
34
- return lifetime
35
-
36
- # String that might represent a Lifetime
37
- if isinstance(lifetime, str):
38
- lifetime_key = lifetime.strip().upper()
39
- if lifetime_key in Lifetime.__members__:
40
- return Lifetime[lifetime_key]
41
-
42
- valid_options = ', '.join(Lifetime.__members__.keys())
43
- raise OrionisContainerTypeError(
44
- f"Invalid lifetime '{lifetime}'. Valid options are: {valid_options}."
45
- )
46
-
47
- # Invalid type
48
- raise OrionisContainerTypeError(
49
- f"Lifetime must be of type str or Lifetime enum, got {type(lifetime).__name__}."
50
- )
51
-
52
- # Exported singleton instance
53
- LifetimeValidator = __LifetimeValidator()