orionis 0.304.0__py3-none-any.whl → 0.305.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/metadata/framework.py +1 -1
- orionis/services/introspection/modules/{reflection_instance.py → reflection_module.py} +1 -1
- orionis/services/introspection/reflection.py +90 -0
- orionis/test/{facade/test_suite.py → test_suite.py} +1 -2
- orionis/unittesting.py +1 -1
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/METADATA +1 -1
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/RECORD +12 -40
- orionis/support/abstracts/__init__.py +0 -0
- orionis/support/abstracts/entities/__init__.py +0 -0
- orionis/support/abstracts/entities/abstract_class_attributes.py +0 -37
- orionis/support/abstracts/reflect_abstract.py +0 -556
- orionis/support/helpers/__init__.py +0 -0
- orionis/support/helpers/functions.py +0 -285
- orionis/support/introspection/__init__.py +0 -0
- orionis/support/introspection/container_integrity.py +0 -292
- orionis/support/introspection/contracts/__init__.py +0 -0
- orionis/support/introspection/contracts/reflection.py +0 -187
- orionis/support/introspection/contracts/reflexion_abstract.py +0 -264
- orionis/support/introspection/helpers/__init__.py +0 -0
- orionis/support/introspection/helpers/functions.py +0 -281
- orionis/support/introspection/instances/__init__.py +0 -0
- orionis/support/introspection/instances/contracts/__init__.py +0 -0
- orionis/support/introspection/instances/contracts/reflection_instance.py +0 -649
- orionis/support/introspection/instances/entities/__init__.py +0 -0
- orionis/support/introspection/instances/reflection_instance.py +0 -758
- orionis/support/introspection/reflect_decorators.py +0 -335
- orionis/support/introspection/reflection.py +0 -216
- orionis/support/introspection/reflexion_concrete.py +0 -276
- orionis/support/introspection/reflexion_concrete_with_abstract.py +0 -185
- orionis/support/introspection/reflexion_instance_with_abstract.py +0 -230
- orionis/support/introspection/reflexion_module.py +0 -19
- orionis/support/introspection/reflexion_module_with_classname.py +0 -22
- orionis/support/reflection.py +0 -216
- orionis/test/facade/__init__.py +0 -0
- orionis/test/facade/contracts/__init__.py +0 -0
- orionis/test/facade/contracts/test_suite.py +0 -25
- /orionis/services/introspection/modules/contracts/{reflection_instance.py → reflection_module.py} +0 -0
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/WHEEL +0 -0
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/top_level.txt +0 -0
- {orionis-0.304.0.dist-info → orionis-0.305.0.dist-info}/zip-safe +0 -0
@@ -1,19 +0,0 @@
|
|
1
|
-
class ReflexionModule:
|
2
|
-
"""A reflection object encapsulating a module.
|
3
|
-
|
4
|
-
Parameters
|
5
|
-
----------
|
6
|
-
module : str
|
7
|
-
The module name being reflected upon
|
8
|
-
|
9
|
-
Attributes
|
10
|
-
----------
|
11
|
-
_module : str
|
12
|
-
The encapsulated module name
|
13
|
-
"""
|
14
|
-
|
15
|
-
def __init__(self, module: str) -> None:
|
16
|
-
"""Initialize with the module name."""
|
17
|
-
self._module = module
|
18
|
-
|
19
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class ReflexionModuleWithClassName:
|
2
|
-
"""A reflection object encapsulating a module and a class name.
|
3
|
-
|
4
|
-
Parameters
|
5
|
-
----------
|
6
|
-
module : str
|
7
|
-
The module name being reflected upon
|
8
|
-
class_name : str
|
9
|
-
The class name in the module
|
10
|
-
|
11
|
-
Attributes
|
12
|
-
----------
|
13
|
-
_module : str
|
14
|
-
The encapsulated module name
|
15
|
-
_class_name : str
|
16
|
-
The encapsulated class name
|
17
|
-
"""
|
18
|
-
|
19
|
-
def __init__(self, module: str, class_name: str) -> None:
|
20
|
-
"""Initialize with the module name and class name."""
|
21
|
-
self._module = module
|
22
|
-
self._class_name = class_name
|
orionis/support/reflection.py
DELETED
@@ -1,216 +0,0 @@
|
|
1
|
-
import abc
|
2
|
-
from typing import Any, Type, TypeVar
|
3
|
-
from orionis._contracts.support.reflection import IReflection
|
4
|
-
from orionis.support.introspection.helpers.functions import HelpersReflection
|
5
|
-
from orionis.support.introspection.abstracts.reflect_abstract import ReflexionAbstract
|
6
|
-
from orionis.support.introspection.reflexion_concrete import ReflexionConcrete
|
7
|
-
from orionis.support.introspection.reflexion_concrete_with_abstract import ReflexionConcreteWithAbstract
|
8
|
-
from orionis.support.introspection.instances.reflection_instance import ReflectionInstance
|
9
|
-
from orionis.support.introspection.reflexion_instance_with_abstract import ReflexionInstanceWithAbstract
|
10
|
-
from orionis.support.introspection.reflexion_module import ReflexionModule
|
11
|
-
from orionis.support.introspection.reflexion_module_with_classname import ReflexionModuleWithClassName
|
12
|
-
|
13
|
-
T = TypeVar('T')
|
14
|
-
ABC = TypeVar('ABC', bound=abc.ABC)
|
15
|
-
|
16
|
-
class Reflection(IReflection):
|
17
|
-
"""A static class providing factory methods for creating reflection objects.
|
18
|
-
|
19
|
-
This class provides methods to create various types of reflection objects
|
20
|
-
that encapsulate different aspects of Python's reflection capabilities.
|
21
|
-
Each method validates its inputs before creating the appropriate reflection object.
|
22
|
-
|
23
|
-
Methods
|
24
|
-
-------
|
25
|
-
instance(instance: Any) -> ReflexionInstance
|
26
|
-
Creates a reflection object for a class instance
|
27
|
-
instanceWithAbstract(instance: Any, abstract: Type[ABC]) -> ReflexionInstanceWithAbstract
|
28
|
-
Creates a reflection object for a class instance with its abstract parent
|
29
|
-
abstract(abstract: Type[ABC]) -> ReflexionAbstract
|
30
|
-
Creates a reflection object for an abstract class
|
31
|
-
concrete(concrete: Type[T]) -> ReflexionConcrete
|
32
|
-
Creates a reflection object for a concrete class
|
33
|
-
concreteWithAbstract(concrete: Type[T], abstract: Type[ABC]) -> ReflexionConcreteWithAbstract
|
34
|
-
Creates a reflection object for a concrete class with its abstract parent
|
35
|
-
module(module: str) -> ReflexionModule
|
36
|
-
Creates a reflection object for a module
|
37
|
-
moduleWithClassName(module: str, class_name: str) -> ReflexionModuleWithClassName
|
38
|
-
Creates a reflection object for a module with a specific class name
|
39
|
-
"""
|
40
|
-
|
41
|
-
@staticmethod
|
42
|
-
def instance(instance: Any) -> 'ReflectionInstance':
|
43
|
-
"""Create a reflection object for a class instance.
|
44
|
-
|
45
|
-
Parameters
|
46
|
-
----------
|
47
|
-
instance : Any
|
48
|
-
The instance to reflect upon
|
49
|
-
|
50
|
-
Returns
|
51
|
-
-------
|
52
|
-
ReflectionInstance
|
53
|
-
A reflection object encapsulating the instance
|
54
|
-
|
55
|
-
Raises
|
56
|
-
------
|
57
|
-
TypeError
|
58
|
-
If the input is not an object instance
|
59
|
-
ValueError
|
60
|
-
If the instance is from builtins, abc, or __main__
|
61
|
-
"""
|
62
|
-
HelpersReflection.ensureUserDefinedClassInstance(instance)
|
63
|
-
return ReflectionInstance(instance)
|
64
|
-
|
65
|
-
@staticmethod
|
66
|
-
def instanceWithAbstract(instance: Any, abstract: Type[ABC]) -> 'ReflexionInstanceWithAbstract':
|
67
|
-
"""Create a reflection object for a class instance with its abstract parent.
|
68
|
-
|
69
|
-
Parameters
|
70
|
-
----------
|
71
|
-
instance : Any
|
72
|
-
The instance to reflect upon
|
73
|
-
abstract : Type[ABC]
|
74
|
-
The abstract parent class
|
75
|
-
|
76
|
-
Returns
|
77
|
-
-------
|
78
|
-
ReflexionInstanceWithAbstract
|
79
|
-
A reflection object encapsulating the instance and its abstract parent
|
80
|
-
|
81
|
-
Raises
|
82
|
-
------
|
83
|
-
TypeError
|
84
|
-
If the instance is not an object or abstract is not a class
|
85
|
-
ValueError
|
86
|
-
If the instance is invalid or abstract is not actually abstract
|
87
|
-
"""
|
88
|
-
HelpersReflection.ensureUserDefinedClassInstance(instance)
|
89
|
-
HelpersReflection.ensureAbstractClass(abstract)
|
90
|
-
return ReflexionInstanceWithAbstract(instance, abstract)
|
91
|
-
|
92
|
-
@staticmethod
|
93
|
-
def abstract(abstract: Type[ABC]) -> 'ReflexionAbstract':
|
94
|
-
"""Create a reflection object for an abstract class.
|
95
|
-
|
96
|
-
Parameters
|
97
|
-
----------
|
98
|
-
abstract : Type[ABC]
|
99
|
-
The abstract class to reflect upon
|
100
|
-
|
101
|
-
Returns
|
102
|
-
-------
|
103
|
-
ReflexionAbstract
|
104
|
-
A reflection object encapsulating the abstract class
|
105
|
-
|
106
|
-
Raises
|
107
|
-
------
|
108
|
-
TypeError
|
109
|
-
If the input is not a class
|
110
|
-
ValueError
|
111
|
-
If the class is not abstract
|
112
|
-
"""
|
113
|
-
HelpersReflection.ensureAbstractClass(abstract)
|
114
|
-
return ReflexionAbstract(abstract)
|
115
|
-
|
116
|
-
@staticmethod
|
117
|
-
def concrete(concrete: Type[T]) -> 'ReflexionConcrete':
|
118
|
-
"""Create a reflection object for a concrete class.
|
119
|
-
|
120
|
-
Parameters
|
121
|
-
----------
|
122
|
-
concrete : Type[T]
|
123
|
-
The concrete class to reflect upon
|
124
|
-
|
125
|
-
Returns
|
126
|
-
-------
|
127
|
-
ReflexionConcrete
|
128
|
-
A reflection object encapsulating the concrete class
|
129
|
-
|
130
|
-
Raises
|
131
|
-
------
|
132
|
-
TypeError
|
133
|
-
If the input is not a class
|
134
|
-
ValueError
|
135
|
-
If the class is abstract or cannot be instantiated
|
136
|
-
"""
|
137
|
-
HelpersReflection.ensureInstantiableClass(concrete)
|
138
|
-
return ReflexionConcrete(concrete)
|
139
|
-
|
140
|
-
@staticmethod
|
141
|
-
def concreteWithAbstract(concrete: Type[T], abstract: Type[ABC]) -> 'ReflexionConcreteWithAbstract':
|
142
|
-
"""Create a reflection object for a concrete class with its abstract parent.
|
143
|
-
|
144
|
-
Parameters
|
145
|
-
----------
|
146
|
-
concrete : Type[T]
|
147
|
-
The concrete class to reflect upon
|
148
|
-
abstract : Type[ABC]
|
149
|
-
The abstract parent class
|
150
|
-
|
151
|
-
Returns
|
152
|
-
-------
|
153
|
-
ReflexionConcreteWithAbstract
|
154
|
-
A reflection object encapsulating the concrete class and its abstract parent
|
155
|
-
|
156
|
-
Raises
|
157
|
-
------
|
158
|
-
TypeError
|
159
|
-
If either input is not a class
|
160
|
-
ValueError
|
161
|
-
If concrete is not instantiable or abstract is not actually abstract
|
162
|
-
"""
|
163
|
-
HelpersReflection.ensureInstantiableClass(concrete)
|
164
|
-
HelpersReflection.ensureAbstractClass(abstract)
|
165
|
-
return ReflexionConcreteWithAbstract(concrete, abstract)
|
166
|
-
|
167
|
-
@staticmethod
|
168
|
-
def module(module: str) -> 'ReflexionModule':
|
169
|
-
"""Create a reflection object for a module.
|
170
|
-
|
171
|
-
Parameters
|
172
|
-
----------
|
173
|
-
module : str
|
174
|
-
The module name to reflect upon
|
175
|
-
|
176
|
-
Returns
|
177
|
-
-------
|
178
|
-
ReflexionModule
|
179
|
-
A reflection object encapsulating the module
|
180
|
-
|
181
|
-
Raises
|
182
|
-
------
|
183
|
-
TypeError
|
184
|
-
If the input is not a string
|
185
|
-
ValueError
|
186
|
-
If the module cannot be imported
|
187
|
-
"""
|
188
|
-
HelpersReflection.ensureValidModule(module)
|
189
|
-
return ReflexionModule(module)
|
190
|
-
|
191
|
-
@staticmethod
|
192
|
-
def moduleWithClassName(module: str, class_name: str) -> 'ReflexionModuleWithClassName':
|
193
|
-
"""Create a reflection object for a module with a specific class name.
|
194
|
-
|
195
|
-
Parameters
|
196
|
-
----------
|
197
|
-
module : str
|
198
|
-
The module name to reflect upon
|
199
|
-
class_name : str
|
200
|
-
The class name to look for in the module
|
201
|
-
|
202
|
-
Returns
|
203
|
-
-------
|
204
|
-
ReflexionModuleWithClassName
|
205
|
-
A reflection object encapsulating the module and class name
|
206
|
-
|
207
|
-
Raises
|
208
|
-
------
|
209
|
-
TypeError
|
210
|
-
If either input is not a string
|
211
|
-
ValueError
|
212
|
-
If the module cannot be imported or the class doesn't exist in it
|
213
|
-
"""
|
214
|
-
HelpersReflection.ensureValidModule(module)
|
215
|
-
HelpersReflection.ensureValidClassName(class_name)
|
216
|
-
return ReflexionModuleWithClassName(module, class_name)
|
orionis/test/facade/__init__.py
DELETED
File without changes
|
File without changes
|
@@ -1,25 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
from orionis.test.suite.test_unit import UnitTest
|
3
|
-
|
4
|
-
class ITestSuite(ABC):
|
5
|
-
|
6
|
-
@abstractmethod
|
7
|
-
def run(self) -> UnitTest:
|
8
|
-
"""
|
9
|
-
Runs the test suite based on the provided configuration.
|
10
|
-
|
11
|
-
Initializes a UnitTest suite, configures it with parameters from the Configuration object,
|
12
|
-
discovers test folders matching the specified pattern, adds the discovered tests to the suite,
|
13
|
-
executes the test suite, and returns the results.
|
14
|
-
|
15
|
-
Returns
|
16
|
-
-------
|
17
|
-
UnitTest
|
18
|
-
The result of the executed test suite.
|
19
|
-
|
20
|
-
Raises
|
21
|
-
------
|
22
|
-
OrionisTestConfigException
|
23
|
-
If the provided configuration is not an instance of Configuration.
|
24
|
-
"""
|
25
|
-
pass
|
/orionis/services/introspection/modules/contracts/{reflection_instance.py → reflection_module.py}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|