orionis 0.658.0__py3-none-any.whl → 0.659.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.
@@ -11,11 +11,6 @@ from orionis.container.entities.binding import Binding
11
11
  from orionis.container.enums.lifetimes import Lifetime
12
12
  from orionis.container.exceptions import OrionisContainerException
13
13
  from orionis.container.exceptions.container import OrionisContainerTypeError
14
- from orionis.container.validators import (
15
- IsCallable,
16
- IsValidAlias,
17
- LifetimeValidator
18
- )
19
14
  from orionis.services.introspection.abstract.reflection import ReflectionAbstract
20
15
  from orionis.services.introspection.callables.reflection import ReflectionCallable
21
16
  from orionis.services.introspection.concretes.reflection import ReflectionConcrete
@@ -35,7 +30,9 @@ class Container(IContainer):
35
30
  # This lock ensures that only one thread can create or access instances at a time
36
31
  _lock = threading.RLock() # RLock allows reentrant locking
37
32
 
38
- def __new__(cls) -> 'Container':
33
+ def __new__(
34
+ cls
35
+ ) -> 'Container':
39
36
  """
40
37
  Creates and returns a singleton instance for each specific class.
41
38
 
@@ -79,7 +76,9 @@ class Container(IContainer):
79
76
  # Return the newly created instance
80
77
  return instance
81
78
 
82
- def __init__(self) -> None:
79
+ def __init__(
80
+ self
81
+ ) -> None:
83
82
  """
84
83
  Initializes the internal state of the container instance.
85
84
 
@@ -113,7 +112,7 @@ class Container(IContainer):
113
112
  self.__singleton_cache = {} # Caches singleton instances
114
113
 
115
114
  # Mark this instance as initialized to prevent re-initialization
116
- self.__initialized = True
115
+ self.__initialized = True # NOSONAR
117
116
 
118
117
  def __handleSyncAsyncResult(
119
118
  self,
@@ -471,47 +470,6 @@ class Container(IContainer):
471
470
  # If no alias is provided, generate a default alias using module and class name
472
471
  return f"{abstract.__module__}.{abstract.__name__}"
473
472
 
474
- def __validateLifetime(self, lifetime: Union[str, Lifetime, Any]) -> Lifetime:
475
- """
476
- Validates and normalizes the provided lifetime value.
477
-
478
- Parameters
479
- ----------
480
- lifetime : Union[str, Lifetime, Any]
481
- The lifetime value to validate. Can be a Lifetime enum or a string
482
- representing a valid lifetime.
483
-
484
- Returns
485
- -------
486
- Lifetime
487
- The validated Lifetime enum value.
488
-
489
- Raises
490
- ------
491
- OrionisContainerTypeError
492
- If the value is not a valid Lifetime enum or string representation,
493
- or if the string doesn't match any valid Lifetime value.
494
- """
495
- # Already a Lifetime enum
496
- if isinstance(lifetime, Lifetime):
497
- return lifetime
498
-
499
- # String that might represent a Lifetime
500
- if isinstance(lifetime, str):
501
- lifetime_key = lifetime.strip().upper()
502
- if lifetime_key in Lifetime.__members__:
503
- return Lifetime[lifetime_key]
504
-
505
- valid_options = ', '.join(Lifetime.__members__.keys())
506
- raise OrionisContainerTypeError(
507
- f"Invalid lifetime '{lifetime}'. Valid options are: {valid_options}."
508
- )
509
-
510
- # Invalid type
511
- raise OrionisContainerTypeError(
512
- f"Lifetime must be of type str or Lifetime enum, got {type(lifetime).__name__}."
513
- )
514
-
515
473
  def transient(
516
474
  self,
517
475
  abstract: Callable[..., Any],
@@ -1179,7 +1137,7 @@ class Container(IContainer):
1179
1137
  # Return None if no binding is found for the requested abstract type or alias
1180
1138
  return None
1181
1139
 
1182
- def __validateBinding(
1140
+ def __validateBinding( # NOSONAR
1183
1141
  self,
1184
1142
  binding: Binding,
1185
1143
  requested_key: Any
@@ -1255,7 +1213,7 @@ class Container(IContainer):
1255
1213
  # Additional validations based on binding type
1256
1214
  self.__validateBindingByType(binding, requested_key)
1257
1215
 
1258
- def __validateBindingByType(
1216
+ def __validateBindingByType( # NOSONAR
1259
1217
  self,
1260
1218
  binding: Binding,
1261
1219
  requested_key: Any
@@ -1322,7 +1280,7 @@ class Container(IContainer):
1322
1280
  f"Invalid alias in binding for '{requested_key}': alias cannot be empty"
1323
1281
  )
1324
1282
 
1325
- def drop(
1283
+ def drop( # NOSONAR
1326
1284
  self,
1327
1285
  abstract: Callable[..., Any] = None,
1328
1286
  alias: str = None
@@ -1938,7 +1896,8 @@ class Container(IContainer):
1938
1896
 
1939
1897
  # If there are unresolved dependencies, raise an exception
1940
1898
  if dependencies.unresolved:
1941
- unresolved_args = [name for name in dependencies.unresolved.keys()]
1899
+ unresolved_args = list(dependencies.unresolved.keys())
1900
+
1942
1901
  raise OrionisContainerException(
1943
1902
  f"Cannot invoke callable '{getattr(fn, '__name__', str(fn))}' because the following required arguments are missing: [{', '.join(unresolved_args)}]."
1944
1903
  )
@@ -2096,7 +2055,8 @@ class Container(IContainer):
2096
2055
 
2097
2056
  # Check for unresolved dependencies
2098
2057
  if dependencies.unresolved:
2099
- unresolved_args = [name for name in dependencies.unresolved.keys()]
2058
+ unresolved_args = list(dependencies.unresolved.keys())
2059
+
2100
2060
  raise OrionisContainerException(
2101
2061
  f"Cannot resolve '{name}' because the following required arguments are missing: [{', '.join(unresolved_args)}]."
2102
2062
  )
@@ -2120,7 +2080,7 @@ class Container(IContainer):
2120
2080
  f"Error resolving dependencies for '{name}': {str(e)}"
2121
2081
  ) from e
2122
2082
 
2123
- def __resolveSingleDependency(
2083
+ def __resolveSingleDependency( # NOSONAR
2124
2084
  self,
2125
2085
  name: str,
2126
2086
  param_name: str,
@@ -2278,12 +2238,7 @@ class Container(IContainer):
2278
2238
  try:
2279
2239
 
2280
2240
  # If explicit arguments are provided, attempt direct instantiation or invocation
2281
- if args or kwargs:
2282
- if isinstance(type_, type):
2283
- # Instantiate the class directly with provided arguments
2284
- return type_(*args, **kwargs)
2285
- elif callable(type_):
2286
- # Invoke the callable directly with provided arguments
2241
+ if args or kwargs and callable(type_):
2287
2242
  return type_(*args, **kwargs)
2288
2243
 
2289
2244
  # Attempt auto-resolution for eligible types
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.658.0"
8
+ VERSION = "0.659.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.658.0
3
+ Version: 0.659.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
@@ -67,7 +67,7 @@ orionis/console/stubs/listener.stub,sha256=DbX-ghx2-vb73kzQ6L20lyg5vSKn58jSLTwFu
67
67
  orionis/console/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  orionis/console/tasks/schedule.py,sha256=ZeeuQ9Tbu5KNowKC5oIk7yWeJXzlDQiQ278mWEgoCXc,87989
69
69
  orionis/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
- orionis/container/container.py,sha256=I6cTRRlDW0kf_7MMKIKXdeNXRur-slMfUTtLRNFyzbA,115945
70
+ orionis/container/container.py,sha256=oj6Wrm_3pY5fvgrXWoFAq8CUfbxHBpXBcauf6LzqZDU,114177
71
71
  orionis/container/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
72
  orionis/container/context/manager.py,sha256=I08K_jKXSKmrq18Pv33qYyMKIlAovVOwIgmfiVm-J7c,2971
73
73
  orionis/container/context/scope.py,sha256=p_oCzR7dDz-5ZAd16ab4vfLc3gBf34CaN0f4iR9D0bQ,1155
@@ -217,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=IrPQJwvQVLRm5Qnz0Cxon4
217
217
  orionis/foundation/providers/testing_provider.py,sha256=eI1p2lUlxl25b5Z487O4nmqLE31CTDb4c3Q21xFadkE,1615
218
218
  orionis/foundation/providers/workers_provider.py,sha256=GdHENYV_yGyqmHJHn0DCyWmWId5xWjD48e6Zq2PGCWY,1674
219
219
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
- orionis/metadata/framework.py,sha256=KfWV8jwgxZcdeY4hlBEHan1VFrSifKQbbvgnOH4dY64,4089
220
+ orionis/metadata/framework.py,sha256=PyWuw6-moXHRfxXdES-vDFIuICRkDMY0mlXcYqm-b5E,4089
221
221
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
222
222
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -404,8 +404,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
404
404
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
405
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
406
406
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
407
- orionis-0.658.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
- orionis-0.658.0.dist-info/METADATA,sha256=pmVWTkhfAxoTOYGL1SFjGeLl-Kat1Un9nPNGZvp56rE,4772
409
- orionis-0.658.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
- orionis-0.658.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
- orionis-0.658.0.dist-info/RECORD,,
407
+ orionis-0.659.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
+ orionis-0.659.0.dist-info/METADATA,sha256=JE66lCLtLLy1kspYW6VF2ufJMkC_TD-fMuvT9ywbC9g,4772
409
+ orionis-0.659.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
+ orionis-0.659.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
+ orionis-0.659.0.dist-info/RECORD,,