orionis 0.304.0__py3-none-any.whl → 0.306.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/{services → support}/standard/std.py +2 -2
- orionis/test/{facade/test_suite.py → test_suite.py} +1 -2
- orionis/unittesting.py +1 -1
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/METADATA +1 -1
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/RECORD +28 -65
- tests/{services → support}/standard/test_services_std.py +3 -3
- tests/{services → support}/wrapper/test_services_wrapper_docdict.py +2 -2
- orionis/support/abstracts/entities/abstract_class_attributes.py +0 -37
- orionis/support/abstracts/reflect_abstract.py +0 -556
- orionis/support/helpers/functions.py +0 -285
- 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
- tests/services/standard/__init__.py +0 -0
- tests/services/wrapper/__init__.py +0 -0
- tests/support/inspection/__init__.py +0 -0
- tests/support/inspection/fakes/__init__.py +0 -0
- tests/support/inspection/fakes/fake_reflect_abstract.py +0 -276
- tests/support/inspection/fakes/fake_reflection_concrete.py +0 -44
- tests/support/inspection/fakes/fake_reflection_concrete_with_abstract.py +0 -78
- tests/support/inspection/fakes/fake_reflection_instance_with_abstract.py +0 -45
- tests/support/inspection/test_reflect_abstract.py +0 -334
- tests/support/inspection/test_reflect_instance.py +0 -288
- tests/support/inspection/test_reflection_concrete.py +0 -142
- tests/support/inspection/test_reflection_concrete_with_abstract.py +0 -87
- tests/support/inspection/test_reflection_instance_with_abstract.py +0 -79
- /orionis/services/introspection/modules/contracts/{reflection_instance.py → reflection_module.py} +0 -0
- /orionis/{services → support}/standard/__init__.py +0 -0
- /orionis/{services → support}/standard/contracts/__init__.py +0 -0
- /orionis/{services → support}/standard/contracts/std.py +0 -0
- /orionis/{services → support}/standard/exceptions/__init__.py +0 -0
- /orionis/{services → support}/standard/exceptions/std_value_exception.py +0 -0
- /orionis/{services → support}/wrapper/__init__.py +0 -0
- /orionis/{services → support}/wrapper/dicts/__init__.py +0 -0
- /orionis/{services → support}/wrapper/dicts/dot_dict.py +0 -0
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/WHEEL +0 -0
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/licenses/LICENCE +0 -0
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/top_level.txt +0 -0
- {orionis-0.304.0.dist-info → orionis-0.306.0.dist-info}/zip-safe +0 -0
- {orionis/support/abstracts → tests/services/inspection/reflection}/__init__.py +0 -0
- {orionis/support/abstracts/entities → tests/services/inspection/reflection/mock}/__init__.py +0 -0
- /tests/{support/inspection/fakes → services/inspection/reflection/mock}/fake_reflect_instance.py +0 -0
- {orionis/support/helpers → tests/support/standard}/__init__.py +0 -0
- {orionis/support/introspection → tests/support/wrapper}/__init__.py +0 -0
@@ -1,187 +0,0 @@
|
|
1
|
-
import abc
|
2
|
-
from abc import ABC, abstractmethod
|
3
|
-
from typing import Any, Type, TypeVar
|
4
|
-
|
5
|
-
T = TypeVar('T')
|
6
|
-
ABC = TypeVar('ABC', bound=abc.ABC)
|
7
|
-
|
8
|
-
class IReflection(ABC):
|
9
|
-
"""Interface for a static reflection factory class.
|
10
|
-
|
11
|
-
Defines the contract for creating various types of reflection objects
|
12
|
-
that encapsulate different aspects of Python's reflection capabilities.
|
13
|
-
"""
|
14
|
-
|
15
|
-
@staticmethod
|
16
|
-
@abstractmethod
|
17
|
-
def instance(instance: Any):
|
18
|
-
"""Create a reflection object for a class instance.
|
19
|
-
|
20
|
-
Parameters
|
21
|
-
----------
|
22
|
-
instance : Any
|
23
|
-
The instance to reflect upon
|
24
|
-
|
25
|
-
Returns
|
26
|
-
-------
|
27
|
-
ReflexionInstance
|
28
|
-
A reflection object encapsulating the instance
|
29
|
-
|
30
|
-
Raises
|
31
|
-
------
|
32
|
-
TypeError
|
33
|
-
If the input is not an object instance
|
34
|
-
ValueError
|
35
|
-
If the instance is from builtins, abc, or __main__
|
36
|
-
"""
|
37
|
-
pass
|
38
|
-
|
39
|
-
@staticmethod
|
40
|
-
@abstractmethod
|
41
|
-
def instanceWithAbstract(instance: Any, abstract: Type[ABC]):
|
42
|
-
"""Create a reflection object for a class instance with its abstract parent.
|
43
|
-
|
44
|
-
Parameters
|
45
|
-
----------
|
46
|
-
instance : Any
|
47
|
-
The instance to reflect upon
|
48
|
-
abstract : Type[ABC]
|
49
|
-
The abstract parent class
|
50
|
-
|
51
|
-
Returns
|
52
|
-
-------
|
53
|
-
ReflexionInstanceWithAbstract
|
54
|
-
A reflection object encapsulating the instance and its abstract parent
|
55
|
-
|
56
|
-
Raises
|
57
|
-
------
|
58
|
-
TypeError
|
59
|
-
If the instance is not an object or abstract is not a class
|
60
|
-
ValueError
|
61
|
-
If the instance is invalid or abstract is not actually abstract
|
62
|
-
"""
|
63
|
-
pass
|
64
|
-
|
65
|
-
@staticmethod
|
66
|
-
@abstractmethod
|
67
|
-
def abstract(abstract: Type[ABC]):
|
68
|
-
"""Create a reflection object for an abstract class.
|
69
|
-
|
70
|
-
Parameters
|
71
|
-
----------
|
72
|
-
abstract : Type[ABC]
|
73
|
-
The abstract class to reflect upon
|
74
|
-
|
75
|
-
Returns
|
76
|
-
-------
|
77
|
-
ReflexionAbstract
|
78
|
-
A reflection object encapsulating the abstract class
|
79
|
-
|
80
|
-
Raises
|
81
|
-
------
|
82
|
-
TypeError
|
83
|
-
If the input is not a class
|
84
|
-
ValueError
|
85
|
-
If the class is not abstract
|
86
|
-
"""
|
87
|
-
pass
|
88
|
-
|
89
|
-
@staticmethod
|
90
|
-
@abstractmethod
|
91
|
-
def concrete(concrete: Type[T]):
|
92
|
-
"""Create a reflection object for a concrete class.
|
93
|
-
|
94
|
-
Parameters
|
95
|
-
----------
|
96
|
-
concrete : Type[T]
|
97
|
-
The concrete class to reflect upon
|
98
|
-
|
99
|
-
Returns
|
100
|
-
-------
|
101
|
-
ReflexionConcrete
|
102
|
-
A reflection object encapsulating the concrete class
|
103
|
-
|
104
|
-
Raises
|
105
|
-
------
|
106
|
-
TypeError
|
107
|
-
If the input is not a class
|
108
|
-
ValueError
|
109
|
-
If the class is abstract or cannot be instantiated
|
110
|
-
"""
|
111
|
-
pass
|
112
|
-
|
113
|
-
@staticmethod
|
114
|
-
@abstractmethod
|
115
|
-
def concreteWithAbstract(concrete: Type[T], abstract: Type[ABC]):
|
116
|
-
"""Create a reflection object for a concrete class with its abstract parent.
|
117
|
-
|
118
|
-
Parameters
|
119
|
-
----------
|
120
|
-
concrete : Type[T]
|
121
|
-
The concrete class to reflect upon
|
122
|
-
abstract : Type[ABC]
|
123
|
-
The abstract parent class
|
124
|
-
|
125
|
-
Returns
|
126
|
-
-------
|
127
|
-
ReflexionConcreteWithAbstract
|
128
|
-
A reflection object encapsulating both classes
|
129
|
-
|
130
|
-
Raises
|
131
|
-
------
|
132
|
-
TypeError
|
133
|
-
If either input is not a class
|
134
|
-
ValueError
|
135
|
-
If concrete is not instantiable or abstract is not actually abstract
|
136
|
-
"""
|
137
|
-
pass
|
138
|
-
|
139
|
-
@staticmethod
|
140
|
-
@abstractmethod
|
141
|
-
def module(module: str):
|
142
|
-
"""Create a reflection object for a module.
|
143
|
-
|
144
|
-
Parameters
|
145
|
-
----------
|
146
|
-
module : str
|
147
|
-
The module name to reflect upon
|
148
|
-
|
149
|
-
Returns
|
150
|
-
-------
|
151
|
-
ReflexionModule
|
152
|
-
A reflection object encapsulating the module
|
153
|
-
|
154
|
-
Raises
|
155
|
-
------
|
156
|
-
TypeError
|
157
|
-
If the input is not a string
|
158
|
-
ValueError
|
159
|
-
If the module cannot be imported
|
160
|
-
"""
|
161
|
-
pass
|
162
|
-
|
163
|
-
@staticmethod
|
164
|
-
@abstractmethod
|
165
|
-
def moduleWithClassName(module: str, class_name: str):
|
166
|
-
"""Create a reflection object for a module with a specific class name.
|
167
|
-
|
168
|
-
Parameters
|
169
|
-
----------
|
170
|
-
module : str
|
171
|
-
The module name to reflect upon
|
172
|
-
class_name : str
|
173
|
-
The class name to look for in the module
|
174
|
-
|
175
|
-
Returns
|
176
|
-
-------
|
177
|
-
ReflexionModuleWithClassName
|
178
|
-
A reflection object encapsulating both the module and class name
|
179
|
-
|
180
|
-
Raises
|
181
|
-
------
|
182
|
-
TypeError
|
183
|
-
If either input is not a string
|
184
|
-
ValueError
|
185
|
-
If the module cannot be imported or the class doesn't exist in it
|
186
|
-
"""
|
187
|
-
pass
|
@@ -1,264 +0,0 @@
|
|
1
|
-
import inspect
|
2
|
-
from abc import ABC, abstractmethod
|
3
|
-
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, TypeVar
|
4
|
-
|
5
|
-
class IReflexionAbstract(ABC):
|
6
|
-
"""Interface for abstract class reflection operations.
|
7
|
-
|
8
|
-
Defines the contract for inspecting and analyzing abstract classes,
|
9
|
-
including their methods, properties, inheritance, and metadata.
|
10
|
-
"""
|
11
|
-
|
12
|
-
@abstractmethod
|
13
|
-
def getClassName(self) -> str:
|
14
|
-
"""Get the name of the abstract class.
|
15
|
-
|
16
|
-
Returns
|
17
|
-
-------
|
18
|
-
str
|
19
|
-
The class name
|
20
|
-
"""
|
21
|
-
pass
|
22
|
-
|
23
|
-
@abstractmethod
|
24
|
-
def getModuleName(self) -> str:
|
25
|
-
"""Get the module name where the abstract class is defined.
|
26
|
-
|
27
|
-
Returns
|
28
|
-
-------
|
29
|
-
str
|
30
|
-
The module name
|
31
|
-
"""
|
32
|
-
pass
|
33
|
-
|
34
|
-
@abstractmethod
|
35
|
-
def getAbstractMethods(self) -> Set[str]:
|
36
|
-
"""Get names of all abstract methods required by the class.
|
37
|
-
|
38
|
-
Returns
|
39
|
-
-------
|
40
|
-
Set[str]
|
41
|
-
Set of abstract method names (excluding properties)
|
42
|
-
"""
|
43
|
-
pass
|
44
|
-
|
45
|
-
@abstractmethod
|
46
|
-
def getAbstractProperties(self) -> Set[str]:
|
47
|
-
"""Get names of all abstract properties required by the class.
|
48
|
-
|
49
|
-
Returns
|
50
|
-
-------
|
51
|
-
Set[str]
|
52
|
-
Set of abstract property names
|
53
|
-
"""
|
54
|
-
pass
|
55
|
-
|
56
|
-
@abstractmethod
|
57
|
-
def getConcreteMethods(self) -> Dict[str, Callable]:
|
58
|
-
"""Get all implemented concrete methods in the abstract class.
|
59
|
-
|
60
|
-
Returns
|
61
|
-
-------
|
62
|
-
Dict[str, Callable]
|
63
|
-
Dictionary mapping method names to their implementations
|
64
|
-
"""
|
65
|
-
pass
|
66
|
-
|
67
|
-
@abstractmethod
|
68
|
-
def getStaticMethods(self) -> List[str]:
|
69
|
-
"""Get names of all static methods in the class.
|
70
|
-
|
71
|
-
Returns
|
72
|
-
-------
|
73
|
-
List[str]
|
74
|
-
List of static method names
|
75
|
-
"""
|
76
|
-
pass
|
77
|
-
|
78
|
-
@abstractmethod
|
79
|
-
def getClassMethods(self) -> List[str]:
|
80
|
-
"""Get names of all class methods in the abstract class.
|
81
|
-
|
82
|
-
Returns
|
83
|
-
-------
|
84
|
-
List[str]
|
85
|
-
List of class method names
|
86
|
-
"""
|
87
|
-
pass
|
88
|
-
|
89
|
-
@abstractmethod
|
90
|
-
def getProperties(self) -> List[str]:
|
91
|
-
"""Get names of all properties in the abstract class.
|
92
|
-
|
93
|
-
Returns
|
94
|
-
-------
|
95
|
-
List[str]
|
96
|
-
List of property names
|
97
|
-
"""
|
98
|
-
pass
|
99
|
-
|
100
|
-
@abstractmethod
|
101
|
-
def getMethodSignature(self, methodName: str) -> inspect.Signature:
|
102
|
-
"""Get the signature of a specific method.
|
103
|
-
|
104
|
-
Parameters
|
105
|
-
----------
|
106
|
-
methodName : str
|
107
|
-
Name of the method to inspect
|
108
|
-
|
109
|
-
Returns
|
110
|
-
-------
|
111
|
-
inspect.Signature
|
112
|
-
The method signature
|
113
|
-
|
114
|
-
Raises
|
115
|
-
------
|
116
|
-
AttributeError
|
117
|
-
If the method doesn't exist
|
118
|
-
"""
|
119
|
-
pass
|
120
|
-
|
121
|
-
@abstractmethod
|
122
|
-
def getPropertySignature(self, propertyName: str) -> inspect.Signature:
|
123
|
-
"""Get the signature of a property's getter method.
|
124
|
-
|
125
|
-
Parameters
|
126
|
-
----------
|
127
|
-
propertyName : str
|
128
|
-
Name of the property to inspect
|
129
|
-
|
130
|
-
Returns
|
131
|
-
-------
|
132
|
-
inspect.Signature
|
133
|
-
The getter signature
|
134
|
-
|
135
|
-
Raises
|
136
|
-
------
|
137
|
-
AttributeError
|
138
|
-
If the property doesn't exist or has no getter
|
139
|
-
"""
|
140
|
-
pass
|
141
|
-
|
142
|
-
@abstractmethod
|
143
|
-
def getDocstring(self) -> Optional[str]:
|
144
|
-
"""Get the class docstring.
|
145
|
-
|
146
|
-
Returns
|
147
|
-
-------
|
148
|
-
Optional[str]
|
149
|
-
The docstring if available
|
150
|
-
"""
|
151
|
-
pass
|
152
|
-
|
153
|
-
@abstractmethod
|
154
|
-
def getBaseAbstractClasses(self) -> Tuple[Type[ABC], ...]:
|
155
|
-
"""Get direct abstract base classes.
|
156
|
-
|
157
|
-
Returns
|
158
|
-
-------
|
159
|
-
Tuple[Type[ABC], ...]
|
160
|
-
Tuple of abstract base classes
|
161
|
-
"""
|
162
|
-
pass
|
163
|
-
|
164
|
-
@abstractmethod
|
165
|
-
def getInterfaceMethods(self) -> Dict[str, inspect.Signature]:
|
166
|
-
"""Get all abstract methods with their signatures.
|
167
|
-
|
168
|
-
Returns
|
169
|
-
-------
|
170
|
-
Dict[str, inspect.Signature]
|
171
|
-
Dictionary mapping method names to their signatures
|
172
|
-
"""
|
173
|
-
pass
|
174
|
-
|
175
|
-
@abstractmethod
|
176
|
-
def isSubclassOf(self, abstract_class: Type[ABC]) -> bool:
|
177
|
-
"""Check inheritance relationship with another abstract class.
|
178
|
-
|
179
|
-
Parameters
|
180
|
-
----------
|
181
|
-
abstract_class : Type[ABC]
|
182
|
-
The abstract class to check against
|
183
|
-
|
184
|
-
Returns
|
185
|
-
-------
|
186
|
-
bool
|
187
|
-
True if this class inherits from the given abstract class
|
188
|
-
"""
|
189
|
-
pass
|
190
|
-
|
191
|
-
@abstractmethod
|
192
|
-
def getSourceCode(self) -> Optional[str]:
|
193
|
-
"""Get the class source code.
|
194
|
-
|
195
|
-
Returns
|
196
|
-
-------
|
197
|
-
Optional[str]
|
198
|
-
The source code if available
|
199
|
-
"""
|
200
|
-
pass
|
201
|
-
|
202
|
-
@abstractmethod
|
203
|
-
def getFileLocation(self) -> Optional[str]:
|
204
|
-
"""Get the file where the class is defined.
|
205
|
-
|
206
|
-
Returns
|
207
|
-
-------
|
208
|
-
Optional[str]
|
209
|
-
File path if available
|
210
|
-
"""
|
211
|
-
pass
|
212
|
-
|
213
|
-
@abstractmethod
|
214
|
-
def getAnnotations(self) -> Dict[str, Any]:
|
215
|
-
"""Get type annotations for the class.
|
216
|
-
|
217
|
-
Returns
|
218
|
-
-------
|
219
|
-
Dict[str, Any]
|
220
|
-
Dictionary of attribute annotations
|
221
|
-
"""
|
222
|
-
pass
|
223
|
-
|
224
|
-
@abstractmethod
|
225
|
-
def getDecorators(self, method_name: str) -> List[str]:
|
226
|
-
"""Get decorators applied to a specific method.
|
227
|
-
|
228
|
-
Parameters
|
229
|
-
----------
|
230
|
-
method_name : str
|
231
|
-
Name of the method to inspect
|
232
|
-
|
233
|
-
Returns
|
234
|
-
-------
|
235
|
-
List[str]
|
236
|
-
List of decorator names
|
237
|
-
"""
|
238
|
-
pass
|
239
|
-
|
240
|
-
@abstractmethod
|
241
|
-
def isProtocol(self) -> bool:
|
242
|
-
"""Check if the class is a Protocol.
|
243
|
-
|
244
|
-
Returns
|
245
|
-
-------
|
246
|
-
bool
|
247
|
-
True if this is a Protocol class
|
248
|
-
"""
|
249
|
-
pass
|
250
|
-
|
251
|
-
@abstractmethod
|
252
|
-
def getRequiredAttributes(self) -> Set[str]:
|
253
|
-
"""For Protocol classes, get required attributes.
|
254
|
-
|
255
|
-
Returns
|
256
|
-
-------
|
257
|
-
Set[str]
|
258
|
-
Set of required attribute names
|
259
|
-
|
260
|
-
Notes
|
261
|
-
-----
|
262
|
-
Returns empty set for non-Protocol classes
|
263
|
-
"""
|
264
|
-
pass
|
File without changes
|