orionis 0.361.0__py3-none-any.whl → 0.363.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/console/output/console.py +1 -1
- orionis/container/container.py +2 -2
- orionis/container/resolver/resolver.py +2 -2
- orionis/container/validators/implements.py +2 -2
- orionis/container/validators/is_abstract_class.py +1 -1
- orionis/container/validators/is_concrete_class.py +1 -1
- orionis/container/validators/is_instance.py +1 -1
- orionis/foundation/config/testing/entities/testing.py +1 -1
- orionis/metadata/framework.py +1 -1
- orionis/services/asynchrony/coroutines.py +3 -3
- orionis/services/asynchrony/exceptions/__init__.py +5 -0
- orionis/services/environment/{dot_env.py → core/dot_env.py} +2 -3
- orionis/services/environment/{types.py → dynamic/types.py} +1 -2
- orionis/services/environment/env.py +1 -20
- orionis/services/environment/exceptions/__init__.py +7 -0
- orionis/services/environment/helpers/functions.py +21 -0
- orionis/services/{parsers/exceptions/exception_parser.py → formatter/exceptions/parser.py} +1 -1
- orionis/services/{parsers → formatter}/serializer.py +1 -1
- orionis/services/introspection/abstract/contracts/__init__.py +0 -0
- orionis/services/introspection/abstract/{reflection_abstract.py → reflection.py} +7 -5
- orionis/services/introspection/callables/contracts/__init__.py +0 -0
- orionis/services/introspection/callables/contracts/reflection.py +141 -0
- orionis/services/introspection/callables/{reflection_callable.py → reflection.py} +7 -4
- orionis/services/introspection/concretes/contracts/__init__.py +0 -0
- orionis/services/introspection/{contracts/reflection_concrete.py → concretes/contracts/concrete.py} +1 -1
- orionis/services/introspection/concretes/{reflection_concrete.py → reflection.py} +8 -6
- orionis/services/introspection/dependencies/contracts/__init__.py +0 -0
- orionis/services/introspection/dependencies/entities/callable_dependencies.py +1 -1
- orionis/services/introspection/dependencies/entities/class_dependencies.py +1 -1
- orionis/services/introspection/dependencies/entities/method_dependencies.py +1 -1
- orionis/services/introspection/dependencies/entities/resolved_dependencies.py +1 -2
- orionis/services/introspection/dependencies/{reflect_dependencies.py → reflection.py} +2 -2
- orionis/services/introspection/exceptions/__init__.py +9 -0
- orionis/services/introspection/instances/contracts/__init__.py +0 -0
- orionis/services/introspection/instances/{reflection_instance.py → reflection.py} +7 -5
- orionis/services/introspection/modules/contracts/__init__.py +0 -0
- orionis/services/introspection/modules/{reflection_module.py → reflection.py} +5 -3
- orionis/services/introspection/objects/__init__.py +0 -0
- orionis/services/introspection/{inspection.py → objects/types.py} +1 -1
- orionis/services/introspection/reflection.py +27 -27
- orionis/services/paths/exceptions/__init__.py +7 -0
- orionis/services/paths/resolver.py +4 -2
- orionis/services/system/runtime/__init__.py +0 -0
- orionis/support/standard/exceptions/__init__.py +5 -0
- orionis/support/standard/std.py +1 -1
- orionis/support/wrapper/__init__.py +5 -0
- orionis/test/contracts/{test_unit.py → unit_test.py} +1 -1
- orionis/test/core/__init__.py +0 -0
- orionis/test/{suite/test_unit.py → core/unit_test.py} +11 -7
- orionis/test/entities/test_result.py +1 -1
- orionis/test/enums/__init__.py +7 -0
- orionis/test/exceptions/__init__.py +13 -0
- orionis/test/logs/history.py +1 -2
- orionis/test/output/dumper.py +1 -1
- orionis/test/output/printer.py +2 -2
- orionis/test/test_suite.py +2 -2
- orionis/unittesting.py +8 -8
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/METADATA +1 -1
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/RECORD +106 -95
- tests/foundation/config/testing/test_foundation_config_testing.py +1 -1
- tests/services/asynchrony/test_services_asynchrony_coroutine.py +1 -1
- tests/services/inspection/dependencies/test_reflect_dependencies.py +1 -1
- tests/services/inspection/reflection/test_reflection_abstract.py +1 -1
- tests/services/inspection/reflection/test_reflection_callable.py +2 -2
- tests/services/inspection/reflection/test_reflection_concrete.py +1 -1
- tests/services/inspection/reflection/test_reflection_instance.py +1 -1
- tests/services/inspection/reflection/test_reflection_module.py +2 -3
- tests/services/parsers/test_services_parser_exceptions.py +1 -1
- tests/services/path/test_services_resolver.py +1 -1
- tests/support/standard/test_services_std.py +1 -1
- tests/support/wrapper/test_services_wrapper_docdict.py +1 -1
- tests/testing/test_testing_result.py +5 -1
- tests/testing/test_testing_unit.py +10 -2
- /orionis/services/asynchrony/exceptions/{coroutine_exception.py → exception.py} +0 -0
- /orionis/services/{introspection/contracts → environment/core}/__init__.py +0 -0
- /orionis/services/{parsers → environment/dynamic}/__init__.py +0 -0
- /orionis/services/environment/exceptions/{environment_value_exception.py → exception.py} +0 -0
- /orionis/services/environment/exceptions/{environment_value_error.py → value.py} +0 -0
- /orionis/services/{parsers/contracts → environment/helpers}/__init__.py +0 -0
- /orionis/services/{parsers/exceptions → formatter}/__init__.py +0 -0
- /orionis/{support/wrapper/dicts → services/formatter/exceptions}/__init__.py +0 -0
- /orionis/{test/suite → services/formatter/exceptions/contracts}/__init__.py +0 -0
- /orionis/services/{parsers/contracts/exception_parser.py → formatter/exceptions/contracts/parser.py} +0 -0
- /orionis/services/introspection/{contracts/reflection_abstract.py → abstract/contracts/reflection.py} +0 -0
- /orionis/services/introspection/{contracts/reflect_dependencies.py → dependencies/contracts/reflection.py} +0 -0
- /orionis/services/introspection/exceptions/{reflection_attribute_error.py → attribute.py} +0 -0
- /orionis/services/introspection/exceptions/{reflection_type_error.py → type.py} +0 -0
- /orionis/services/introspection/exceptions/{reflection_value_error.py → value.py} +0 -0
- /orionis/services/introspection/{contracts/reflection_instance.py → instances/contracts/reflection.py} +0 -0
- /orionis/services/introspection/{contracts/reflection_module.py → modules/contracts/reflection.py} +0 -0
- /orionis/services/paths/exceptions/{path_value_exceptions.py → exception.py} +0 -0
- /orionis/services/paths/exceptions/{not_found_exceptions.py → file.py} +0 -0
- /orionis/services/system/{runtime_imports.py → runtime/imports.py} +0 -0
- /orionis/support/standard/exceptions/{std_value_exception.py → value.py} +0 -0
- /orionis/support/wrapper/{dicts/dot_dict.py → dot_dict.py} +0 -0
- /orionis/test/enums/{test_mode.py → execution_mode.py} +0 -0
- /orionis/test/enums/{test_status.py → status.py} +0 -0
- /orionis/test/exceptions/{test_config_exception.py → config.py} +0 -0
- /orionis/test/exceptions/{test_failure_exception.py → failure.py} +0 -0
- /orionis/test/exceptions/{test_persistence_error.py → persistence.py} +0 -0
- /orionis/test/exceptions/{test_runtime_error.py → runtime.py} +0 -0
- /orionis/test/exceptions/{test_value_error.py → value.py} +0 -0
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/WHEEL +0 -0
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/top_level.txt +0 -0
- {orionis-0.361.0.dist-info → orionis-0.363.0.dist-info}/zip-safe +0 -0
|
@@ -4,7 +4,7 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
from orionis.console.output.styles import ANSIColors
|
|
6
6
|
from orionis._contracts.console.output.console import IConsole
|
|
7
|
-
from orionis.services.
|
|
7
|
+
from orionis.services.formatter.serializer import Parser
|
|
8
8
|
|
|
9
9
|
class Console(IConsole):
|
|
10
10
|
"""
|
orionis/container/container.py
CHANGED
|
@@ -15,8 +15,8 @@ from orionis.container.validators.is_not_subclass import IsNotSubclass
|
|
|
15
15
|
from orionis.container.validators.is_subclass import IsSubclass
|
|
16
16
|
from orionis.container.validators.is_valid_alias import IsValidAlias
|
|
17
17
|
from orionis.container.validators.lifetime import LifetimeValidator
|
|
18
|
-
from orionis.services.introspection.abstract.
|
|
19
|
-
from orionis.services.introspection.callables.
|
|
18
|
+
from orionis.services.introspection.abstract.reflection import ReflectionAbstract
|
|
19
|
+
from orionis.services.introspection.callables.reflection import ReflectionCallable
|
|
20
20
|
|
|
21
21
|
class Container(IContainer):
|
|
22
22
|
|
|
@@ -4,8 +4,8 @@ from orionis.container.contracts.container import IContainer
|
|
|
4
4
|
from orionis.container.entities.binding import Binding
|
|
5
5
|
from orionis.container.enums.lifetimes import Lifetime
|
|
6
6
|
from orionis.container.exceptions import OrionisContainerException
|
|
7
|
-
from orionis.services.introspection.callables.
|
|
8
|
-
from orionis.services.introspection.concretes.
|
|
7
|
+
from orionis.services.introspection.callables.reflection import ReflectionCallable
|
|
8
|
+
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
9
9
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
10
10
|
|
|
11
11
|
class Resolver:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.
|
|
2
|
+
from orionis.services.introspection.objects.types import Type
|
|
3
3
|
from orionis.container.exceptions import OrionisContainerException
|
|
4
4
|
|
|
5
5
|
class __ImplementsAbstractMethods:
|
|
@@ -50,7 +50,7 @@ class __ImplementsAbstractMethods:
|
|
|
50
50
|
raise OrionisContainerException("Either concrete class or instance must be provided for implementation check.")
|
|
51
51
|
|
|
52
52
|
# Validate that the target is a class or instance
|
|
53
|
-
target_class = target if
|
|
53
|
+
target_class = target if Type(target).isClass() else target.__class__
|
|
54
54
|
target_name = target_class.__name__
|
|
55
55
|
abstract_name = abstract.__name__
|
|
56
56
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.abstract.
|
|
2
|
+
from orionis.services.introspection.abstract.reflection import ReflectionAbstract
|
|
3
3
|
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
4
|
|
|
5
5
|
class __IsAbstractClass:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Callable, Any
|
|
2
|
-
from orionis.services.introspection.concretes.
|
|
2
|
+
from orionis.services.introspection.concretes.reflection import ReflectionConcrete
|
|
3
3
|
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
4
|
|
|
5
5
|
class __IsConcreteClass:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Any
|
|
2
|
-
from orionis.services.introspection.instances.
|
|
2
|
+
from orionis.services.introspection.instances.reflection import ReflectionInstance
|
|
3
3
|
from orionis.container.exceptions import OrionisContainerTypeError
|
|
4
4
|
|
|
5
5
|
class __IsInstance:
|
|
@@ -2,7 +2,7 @@ from dataclasses import asdict, dataclass, field, fields
|
|
|
2
2
|
from typing import List
|
|
3
3
|
from orionis.foundation.exceptions import OrionisIntegrityException
|
|
4
4
|
from orionis.services.system.workers import Workers
|
|
5
|
-
from orionis.test.enums.
|
|
5
|
+
from orionis.test.enums.execution_mode import ExecutionMode
|
|
6
6
|
|
|
7
7
|
@dataclass(unsafe_hash=True, kw_only=True)
|
|
8
8
|
class Testing:
|
orionis/metadata/framework.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
from typing import Any, Coroutine as TypingCoroutine, TypeVar, Union
|
|
3
3
|
from orionis.services.asynchrony.contracts.coroutines import ICoroutine
|
|
4
|
-
from orionis.services.asynchrony.exceptions
|
|
5
|
-
from orionis.services.introspection.
|
|
4
|
+
from orionis.services.asynchrony.exceptions import OrionisCoroutineException
|
|
5
|
+
from orionis.services.introspection.objects.types import Type
|
|
6
6
|
|
|
7
7
|
T = TypeVar("T")
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ class Coroutine(ICoroutine):
|
|
|
36
36
|
OrionisCoroutineException
|
|
37
37
|
If the provided object is not a coroutine.
|
|
38
38
|
"""
|
|
39
|
-
if not
|
|
39
|
+
if not Type(func).isCoroutine():
|
|
40
40
|
raise OrionisCoroutineException(
|
|
41
41
|
f"Expected a coroutine object, but got {type(func).__name__}."
|
|
42
42
|
)
|
|
@@ -6,9 +6,8 @@ from pathlib import Path
|
|
|
6
6
|
from typing import Any, Optional, Union
|
|
7
7
|
from dotenv import dotenv_values, load_dotenv, set_key, unset_key
|
|
8
8
|
from orionis.patterns.singleton.meta import Singleton
|
|
9
|
-
from orionis.services.environment.exceptions
|
|
10
|
-
from orionis.services.environment.
|
|
11
|
-
from orionis.services.environment.types import EnvTypes
|
|
9
|
+
from orionis.services.environment.exceptions import OrionisEnvironmentValueException, OrionisEnvironmentValueError
|
|
10
|
+
from orionis.services.environment.dynamic.types import EnvTypes
|
|
12
11
|
|
|
13
12
|
class DotEnv(metaclass=Singleton):
|
|
14
13
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from orionis.services.environment.contracts.types import IEnvTypes
|
|
2
|
-
from orionis.services.environment.exceptions
|
|
3
|
-
from orionis.services.environment.exceptions.environment_value_exception import OrionisEnvironmentValueException
|
|
2
|
+
from orionis.services.environment.exceptions import OrionisEnvironmentValueError, OrionisEnvironmentValueException
|
|
4
3
|
|
|
5
4
|
class EnvTypes(IEnvTypes):
|
|
6
5
|
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
from orionis.services.environment.contracts.env import IEnv
|
|
2
|
-
from orionis.services.environment.dot_env import DotEnv
|
|
2
|
+
from orionis.services.environment.core.dot_env import DotEnv
|
|
3
3
|
from typing import Any, Dict
|
|
4
4
|
|
|
5
|
-
def env(key: str, default: Any = None) -> Any:
|
|
6
|
-
"""
|
|
7
|
-
Retrieve the value of an environment variable.
|
|
8
|
-
|
|
9
|
-
Parameters
|
|
10
|
-
----------
|
|
11
|
-
key : str
|
|
12
|
-
The name of the environment variable to retrieve.
|
|
13
|
-
default : Any, optional
|
|
14
|
-
The value to return if the environment variable is not found. Default is None.
|
|
15
|
-
|
|
16
|
-
Returns
|
|
17
|
-
-------
|
|
18
|
-
Any
|
|
19
|
-
The value of the environment variable if it exists, otherwise the default value.
|
|
20
|
-
"""
|
|
21
|
-
dotenv = DotEnv()
|
|
22
|
-
return dotenv.get(key, default)
|
|
23
|
-
|
|
24
5
|
class Env(IEnv):
|
|
25
6
|
|
|
26
7
|
@staticmethod
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from orionis.services.environment.core.dot_env import DotEnv
|
|
3
|
+
|
|
4
|
+
def env(key: str, default: Any = None) -> Any:
|
|
5
|
+
"""
|
|
6
|
+
Retrieve the value of an environment variable.
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
----------
|
|
10
|
+
key : str
|
|
11
|
+
The name of the environment variable to retrieve.
|
|
12
|
+
default : Any, optional
|
|
13
|
+
The value to return if the environment variable is not found. Default is None.
|
|
14
|
+
|
|
15
|
+
Returns
|
|
16
|
+
-------
|
|
17
|
+
Any
|
|
18
|
+
The value of the environment variable if it exists, otherwise the default value.
|
|
19
|
+
"""
|
|
20
|
+
dotenv = DotEnv()
|
|
21
|
+
return dotenv.get(key, default)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import traceback
|
|
2
2
|
from typing import Any, Dict, List, Optional, Union
|
|
3
|
-
from orionis.services.
|
|
3
|
+
from orionis.services.formatter.exceptions.contracts.parser import IExceptionParser
|
|
4
4
|
|
|
5
5
|
class ExceptionParser(IExceptionParser):
|
|
6
6
|
"""
|
|
File without changes
|
|
@@ -2,13 +2,15 @@ import inspect
|
|
|
2
2
|
import keyword
|
|
3
3
|
from abc import ABC
|
|
4
4
|
from typing import List, Type
|
|
5
|
-
from orionis.services.introspection.contracts.
|
|
5
|
+
from orionis.services.introspection.abstract.contracts.reflection import IReflectionAbstract
|
|
6
6
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
7
7
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
|
8
|
-
from orionis.services.introspection.dependencies.
|
|
9
|
-
from orionis.services.introspection.exceptions
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
from orionis.services.introspection.dependencies.reflection import ReflectDependencies
|
|
9
|
+
from orionis.services.introspection.exceptions import (
|
|
10
|
+
ReflectionAttributeError,
|
|
11
|
+
ReflectionTypeError,
|
|
12
|
+
ReflectionValueError
|
|
13
|
+
)
|
|
12
14
|
|
|
13
15
|
class ReflectionAbstract(IReflectionAbstract):
|
|
14
16
|
|
|
File without changes
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
class IReflectionCallable(ABC):
|
|
4
|
+
|
|
5
|
+
@abstractmethod
|
|
6
|
+
def getCallable(self) -> callable:
|
|
7
|
+
"""
|
|
8
|
+
Retrieve the callable function associated with this instance.
|
|
9
|
+
Returns
|
|
10
|
+
-------
|
|
11
|
+
callable
|
|
12
|
+
The function object encapsulated by this instance.
|
|
13
|
+
"""
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
def getName(self) -> str:
|
|
18
|
+
"""
|
|
19
|
+
Returns
|
|
20
|
+
-------
|
|
21
|
+
str
|
|
22
|
+
The name of the function.
|
|
23
|
+
"""
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
@abstractmethod
|
|
27
|
+
def getModuleName(self) -> str:
|
|
28
|
+
"""
|
|
29
|
+
Get the name of the module where the underlying function is defined.
|
|
30
|
+
Returns
|
|
31
|
+
-------
|
|
32
|
+
str
|
|
33
|
+
The name of the module in which the function was originally declared.
|
|
34
|
+
"""
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def getModuleWithCallableName(self) -> str:
|
|
39
|
+
"""
|
|
40
|
+
Get the fully qualified name of the callable, including its module.
|
|
41
|
+
Returns
|
|
42
|
+
-------
|
|
43
|
+
str
|
|
44
|
+
A string consisting of the module name and the callable name, separated by a dot.
|
|
45
|
+
"""
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
@abstractmethod
|
|
49
|
+
def getDocstring(self) -> str:
|
|
50
|
+
"""
|
|
51
|
+
Retrieve the docstring of the callable function.
|
|
52
|
+
Returns
|
|
53
|
+
-------
|
|
54
|
+
str
|
|
55
|
+
The docstring associated with the function. Returns an empty string if no docstring is present.
|
|
56
|
+
"""
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
@abstractmethod
|
|
60
|
+
def getSourceCode(self) -> str:
|
|
61
|
+
"""
|
|
62
|
+
Retrieve the source code of the wrapped callable.
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
str
|
|
66
|
+
The source code of the callable function as a string. If the source code
|
|
67
|
+
cannot be retrieved, a ReflectionAttributeError is raised.
|
|
68
|
+
Raises
|
|
69
|
+
------
|
|
70
|
+
ReflectionAttributeError
|
|
71
|
+
If the source code cannot be obtained due to an OSError.
|
|
72
|
+
"""
|
|
73
|
+
pass
|
|
74
|
+
|
|
75
|
+
@abstractmethod
|
|
76
|
+
def getFile(self) -> str:
|
|
77
|
+
"""
|
|
78
|
+
Retrieve the filename where the underlying callable function is defined.
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
str
|
|
82
|
+
The absolute path to the source file containing the callable.
|
|
83
|
+
Raises
|
|
84
|
+
------
|
|
85
|
+
TypeError
|
|
86
|
+
If the underlying object is a built-in function or method, or if its source file cannot be determined.
|
|
87
|
+
"""
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
@abstractmethod
|
|
91
|
+
def call(self, *args, **kwargs):
|
|
92
|
+
"""
|
|
93
|
+
Call the wrapped function with the provided arguments.
|
|
94
|
+
If the wrapped function is asynchronous, it will be executed using `asyncio.run`.
|
|
95
|
+
Parameters
|
|
96
|
+
----------
|
|
97
|
+
*args : tuple
|
|
98
|
+
Positional arguments to pass to the function.
|
|
99
|
+
**kwargs : dict
|
|
100
|
+
Keyword arguments to pass to the function.
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
Any
|
|
104
|
+
The result returned by the function call.
|
|
105
|
+
Raises
|
|
106
|
+
------
|
|
107
|
+
Exception
|
|
108
|
+
Propagates any exception raised by the called function.
|
|
109
|
+
"""
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
@abstractmethod
|
|
113
|
+
def getSignature(self):
|
|
114
|
+
"""
|
|
115
|
+
Retrieve the signature of the callable function.
|
|
116
|
+
Returns
|
|
117
|
+
-------
|
|
118
|
+
inspect.Signature
|
|
119
|
+
An `inspect.Signature` object representing the callable's signature.
|
|
120
|
+
Notes
|
|
121
|
+
-----
|
|
122
|
+
This method provides detailed information about the parameters of the callable,
|
|
123
|
+
including their names, default values, and annotations.
|
|
124
|
+
"""
|
|
125
|
+
pass
|
|
126
|
+
|
|
127
|
+
@abstractmethod
|
|
128
|
+
def getDependencies(self):
|
|
129
|
+
"""
|
|
130
|
+
Analyzes the callable associated with this instance and retrieves its dependencies.
|
|
131
|
+
CallableDependency
|
|
132
|
+
An object containing information about the callable's dependencies, including:
|
|
133
|
+
- resolved: dict
|
|
134
|
+
A dictionary mapping parameter names to their resolved values (e.g., default values or injected dependencies).
|
|
135
|
+
- unresolved: list of str
|
|
136
|
+
A list of parameter names that could not be resolved (i.e., parameters without default values or missing annotations).
|
|
137
|
+
Notes
|
|
138
|
+
-----
|
|
139
|
+
This method leverages the `ReflectDependencies` utility to inspect the callable and determine which dependencies are satisfied and which remain unresolved.
|
|
140
|
+
"""
|
|
141
|
+
pass
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
from orionis.services.asynchrony.coroutines import Coroutine
|
|
3
|
+
from orionis.services.introspection.callables.contracts.reflection import IReflectionCallable
|
|
3
4
|
from orionis.services.introspection.dependencies.entities.callable_dependencies import CallableDependency
|
|
4
|
-
from orionis.services.introspection.dependencies.
|
|
5
|
-
from orionis.services.introspection.exceptions
|
|
6
|
-
|
|
5
|
+
from orionis.services.introspection.dependencies.reflection import ReflectDependencies
|
|
6
|
+
from orionis.services.introspection.exceptions import (
|
|
7
|
+
ReflectionAttributeError,
|
|
8
|
+
ReflectionTypeError
|
|
9
|
+
)
|
|
7
10
|
|
|
8
|
-
class ReflectionCallable:
|
|
11
|
+
class ReflectionCallable(IReflectionCallable):
|
|
9
12
|
|
|
10
13
|
def __init__(self, fn: callable) -> None:
|
|
11
14
|
"""
|
|
File without changes
|
orionis/services/introspection/{contracts/reflection_concrete.py → concretes/contracts/concrete.py}
RENAMED
|
@@ -3,7 +3,7 @@ import inspect
|
|
|
3
3
|
from typing import Any, Callable, List, Type
|
|
4
4
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
5
5
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
|
6
|
-
from orionis.services.introspection.instances.
|
|
6
|
+
from orionis.services.introspection.instances.reflection import ReflectionInstance
|
|
7
7
|
|
|
8
8
|
class IReflectionConcrete(ABC):
|
|
9
9
|
|
|
@@ -3,14 +3,16 @@ import inspect
|
|
|
3
3
|
import keyword
|
|
4
4
|
from typing import Any, Callable, List, Type
|
|
5
5
|
from orionis.services.asynchrony.coroutines import Coroutine
|
|
6
|
-
from orionis.services.introspection.contracts.
|
|
6
|
+
from orionis.services.introspection.concretes.contracts.concrete import IReflectionConcrete
|
|
7
7
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
8
8
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
|
9
|
-
from orionis.services.introspection.dependencies.
|
|
10
|
-
from orionis.services.introspection.exceptions
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
from orionis.services.introspection.dependencies.reflection import ReflectDependencies
|
|
10
|
+
from orionis.services.introspection.exceptions import (
|
|
11
|
+
ReflectionAttributeError,
|
|
12
|
+
ReflectionTypeError,
|
|
13
|
+
ReflectionValueError
|
|
14
|
+
)
|
|
15
|
+
from orionis.services.introspection.instances.reflection import ReflectionInstance
|
|
14
16
|
|
|
15
17
|
class ReflectionConcrete(IReflectionConcrete):
|
|
16
18
|
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Any, Dict, List
|
|
3
3
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
4
|
-
from orionis.services.introspection.exceptions
|
|
4
|
+
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
5
|
|
|
6
6
|
@dataclass(frozen=True, kw_only=True)
|
|
7
7
|
class CallableDependency:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Any, Dict, List
|
|
3
3
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
4
|
-
from orionis.services.introspection.exceptions
|
|
4
|
+
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
5
|
|
|
6
6
|
@dataclass(frozen=True, kw_only=True)
|
|
7
7
|
class ClassDependency:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Any, Dict, List
|
|
3
3
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
4
|
-
from orionis.services.introspection.exceptions
|
|
4
|
+
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
5
|
|
|
6
6
|
@dataclass(frozen=True, kw_only=True)
|
|
7
7
|
class MethodDependency:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from typing import Type, Any
|
|
3
|
-
|
|
4
|
-
from orionis.services.introspection.exceptions.reflection_type_error import ReflectionTypeError
|
|
3
|
+
from orionis.services.introspection.exceptions import ReflectionTypeError
|
|
5
4
|
|
|
6
5
|
@dataclass(frozen=True, kw_only=True)
|
|
7
6
|
class ResolvedDependency:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
from typing import Any, Dict, List
|
|
3
|
-
from orionis.services.introspection.contracts.
|
|
3
|
+
from orionis.services.introspection.dependencies.contracts.reflection import IReflectDependencies
|
|
4
4
|
from orionis.services.introspection.dependencies.entities.callable_dependencies import CallableDependency
|
|
5
5
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
6
6
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
|
7
7
|
from orionis.services.introspection.dependencies.entities.resolved_dependencies import ResolvedDependency
|
|
8
|
-
from orionis.services.introspection.exceptions
|
|
8
|
+
from orionis.services.introspection.exceptions import ReflectionValueError
|
|
9
9
|
|
|
10
10
|
class ReflectDependencies(IReflectDependencies):
|
|
11
11
|
"""
|
|
File without changes
|
|
@@ -4,11 +4,13 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Type
|
|
|
4
4
|
from orionis.services.asynchrony.coroutines import Coroutine
|
|
5
5
|
from orionis.services.introspection.dependencies.entities.class_dependencies import ClassDependency
|
|
6
6
|
from orionis.services.introspection.dependencies.entities.method_dependencies import MethodDependency
|
|
7
|
-
from orionis.services.introspection.dependencies.
|
|
8
|
-
from orionis.services.introspection.exceptions
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
from orionis.services.introspection.dependencies.reflection import ReflectDependencies
|
|
8
|
+
from orionis.services.introspection.exceptions import (
|
|
9
|
+
ReflectionAttributeError,
|
|
10
|
+
ReflectionTypeError,
|
|
11
|
+
ReflectionValueError
|
|
12
|
+
)
|
|
13
|
+
from orionis.services.introspection.instances.contracts.reflection import IReflectionInstance
|
|
12
14
|
|
|
13
15
|
class ReflectionInstance(IReflectionInstance):
|
|
14
16
|
|
|
File without changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import importlib
|
|
2
2
|
import inspect
|
|
3
3
|
import keyword
|
|
4
|
-
from orionis.services.introspection.exceptions
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
from orionis.services.introspection.exceptions import (
|
|
5
|
+
ReflectionTypeError,
|
|
6
|
+
ReflectionValueError
|
|
7
|
+
)
|
|
8
|
+
from orionis.services.introspection.modules.contracts.reflection import IReflectionModule
|
|
7
9
|
|
|
8
10
|
class ReflectionModule(IReflectionModule):
|
|
9
11
|
|
|
File without changes
|