iris-pex-embedded-python 3.7.1b3__tar.gz → 3.7.1b5__tar.gz
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.
- {iris_pex_embedded_python-3.7.1b3/src/iris_pex_embedded_python.egg-info → iris_pex_embedded_python-3.7.1b5}/PKG-INFO +3 -3
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/pyproject.toml +3 -3
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_dispatch.py +49 -21
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_persistent_message.py +47 -63
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5/src/iris_pex_embedded_python.egg-info}/PKG-INFO +3 -3
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iris_pex_embedded_python.egg-info/requires.txt +2 -2
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/LICENSE +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/README.md +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/setup.cfg +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/setup.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/__init__.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/__init__.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/__main__.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_business_host.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_cli.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_common.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_director.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_utils.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/__init__.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/__main__.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_async_request.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_host.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_operation.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_process.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_service.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_cli.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_common.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_debugpy.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_decorators.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_director.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_director_protocol.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_generator_request.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_inbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_iris.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_local.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_log_manager.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_message.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_message_validator.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_outbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_private_session_duplex.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_private_session_process.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_remote.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_serialization.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_utils.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Common.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Director.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Generator/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Generator/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Generator/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Generator/Message/StartPickle.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Generator/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Message.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Projection.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Service/Remote/Handler.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Service/Remote/Rest/v1.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Test.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Utils.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Wrapper.cls +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iris_pex_embedded_python.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.1b5
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -43,8 +43,8 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
License-File: LICENSE
|
|
44
44
|
Requires-Dist: pydantic>=2.0.0
|
|
45
45
|
Requires-Dist: xmltodict>=0.12.0
|
|
46
|
-
Requires-Dist: iris-embedded-python-wrapper>=0.0
|
|
47
|
-
Requires-Dist: iris-persistence>=0.1.
|
|
46
|
+
Requires-Dist: iris-embedded-python-wrapper>=0.5.0
|
|
47
|
+
Requires-Dist: iris-persistence>=0.1.1
|
|
48
48
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
49
49
|
Requires-Dist: debugpy>=1.8.0
|
|
50
50
|
Requires-Dist: requests>=2.24.0
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "iris_pex_embedded_python"
|
|
6
|
-
version = "3.7.
|
|
6
|
+
version = "3.7.1b5"
|
|
7
7
|
description = "Iris Interoperability based on Embedded Python"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.10"
|
|
@@ -26,8 +26,8 @@ classifiers = [
|
|
|
26
26
|
dependencies = [
|
|
27
27
|
"pydantic>=2.0.0",
|
|
28
28
|
"xmltodict>=0.12.0",
|
|
29
|
-
"iris-embedded-python-wrapper>=0.0
|
|
30
|
-
"iris-persistence>=0.1.
|
|
29
|
+
"iris-embedded-python-wrapper>=0.5.0",
|
|
30
|
+
"iris-persistence>=0.1.1",
|
|
31
31
|
"jsonpath-ng>=1.7.0",
|
|
32
32
|
"debugpy>=1.8.0",
|
|
33
33
|
"requests>=2.24.0"
|
|
@@ -16,11 +16,24 @@ from ._message_validator import (
|
|
|
16
16
|
)
|
|
17
17
|
from ._persistent_message import (
|
|
18
18
|
deserialize_persistent_message,
|
|
19
|
+
get_iris_object_classname,
|
|
19
20
|
is_persistent_message_instance,
|
|
20
21
|
serialize_persistent_message,
|
|
21
22
|
)
|
|
22
23
|
|
|
23
24
|
|
|
25
|
+
_MESSAGE_CLASSES = {
|
|
26
|
+
"IOP.Message",
|
|
27
|
+
"Grongier.PEX.Message",
|
|
28
|
+
"IOP.Generator.Message.Start",
|
|
29
|
+
}
|
|
30
|
+
_PICKLE_MESSAGE_CLASSES = {
|
|
31
|
+
"IOP.PickleMessage",
|
|
32
|
+
"Grongier.PEX.PickleMessage",
|
|
33
|
+
"IOP.Generator.Message.StartPickle",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
24
37
|
def dispatch_serializer(message: Any, is_generator: bool = False) -> Any:
|
|
25
38
|
"""Serializes the message based on its type.
|
|
26
39
|
|
|
@@ -69,25 +82,28 @@ def dispatch_deserializer(serial: Any) -> Any:
|
|
|
69
82
|
Returns:
|
|
70
83
|
The deserialized message
|
|
71
84
|
"""
|
|
72
|
-
if (
|
|
73
|
-
serial
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
if serial is None or not type(serial).__module__.startswith("iris"):
|
|
86
|
+
return serial
|
|
87
|
+
|
|
88
|
+
iris_classname = get_iris_object_classname(serial)
|
|
89
|
+
|
|
90
|
+
if iris_classname in _MESSAGE_CLASSES:
|
|
77
91
|
return deserialize_message(serial)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
and type(serial).__module__.startswith("iris")
|
|
81
|
-
and (
|
|
82
|
-
serial._IsA("IOP.PickleMessage")
|
|
83
|
-
or serial._IsA("Grongier.PEX.PickleMessage")
|
|
84
|
-
)
|
|
85
|
-
):
|
|
92
|
+
|
|
93
|
+
if iris_classname in _PICKLE_MESSAGE_CLASSES:
|
|
86
94
|
return deserialize_pickle_message(serial)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return
|
|
95
|
+
|
|
96
|
+
deserialized = deserialize_persistent_message(serial, iris_classname=iris_classname)
|
|
97
|
+
if deserialized is not serial:
|
|
98
|
+
return deserialized
|
|
99
|
+
|
|
100
|
+
if serial._IsA("IOP.Message") or serial._IsA("Grongier.PEX.Message"):
|
|
101
|
+
return deserialize_message(serial)
|
|
102
|
+
|
|
103
|
+
if serial._IsA("IOP.PickleMessage") or serial._IsA("Grongier.PEX.PickleMessage"):
|
|
104
|
+
return deserialize_pickle_message(serial)
|
|
105
|
+
|
|
106
|
+
return serial
|
|
91
107
|
|
|
92
108
|
|
|
93
109
|
def dispach_message(host: Any, request: Any) -> Any:
|
|
@@ -116,13 +132,25 @@ def create_dispatch(host: Any) -> None:
|
|
|
116
132
|
The dispatch table consists of tuples of (fully_qualified_class_name, method_name).
|
|
117
133
|
Only methods that take a single typed parameter are considered as handlers.
|
|
118
134
|
"""
|
|
119
|
-
|
|
120
|
-
return
|
|
135
|
+
dispatch = _declared_dispatch(host)
|
|
121
136
|
|
|
122
137
|
for method_name in get_callable_methods(host):
|
|
123
138
|
handler_info = get_handler_info(host, method_name)
|
|
124
|
-
if handler_info:
|
|
125
|
-
|
|
139
|
+
if handler_info and handler_info not in dispatch:
|
|
140
|
+
dispatch.append(handler_info)
|
|
141
|
+
|
|
142
|
+
host.DISPATCH = dispatch
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def _declared_dispatch(host: Any) -> List[Tuple[str, str]]:
|
|
146
|
+
if "DISPATCH" in getattr(host, "__dict__", {}):
|
|
147
|
+
return list(host.__dict__["DISPATCH"])
|
|
148
|
+
|
|
149
|
+
class_dispatch = host.__class__.__dict__.get("DISPATCH")
|
|
150
|
+
if class_dispatch is not None:
|
|
151
|
+
return list(class_dispatch)
|
|
152
|
+
|
|
153
|
+
return []
|
|
126
154
|
|
|
127
155
|
|
|
128
156
|
def get_callable_methods(host: Any) -> List[str]:
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_persistent_message.py
RENAMED
|
@@ -6,13 +6,10 @@ import os
|
|
|
6
6
|
import sys
|
|
7
7
|
from typing import Any, Optional
|
|
8
8
|
|
|
9
|
+
import iris_persistence
|
|
9
10
|
from iris_persistence import Field as Field
|
|
10
11
|
from iris_persistence import Model
|
|
11
12
|
from iris_persistence.models import ModelMeta
|
|
12
|
-
from iris_persistence.query import (
|
|
13
|
-
_build_model_from_iris_obj,
|
|
14
|
-
_materialize_related_value,
|
|
15
|
-
)
|
|
16
13
|
from iris_persistence.runtime import get_runtime
|
|
17
14
|
|
|
18
15
|
|
|
@@ -27,6 +24,7 @@ _PYTHON_TO_IRIS_CACHE: dict[str, str] = {}
|
|
|
27
24
|
_IRIS_TO_PYTHON_CACHE: dict[str, str] = {}
|
|
28
25
|
_IRIS_TO_PYTHON_CLASSPATH_CACHE: dict[str, str] = {}
|
|
29
26
|
_IRIS_TO_PYTHON_STRICT_CACHE: dict[str, bool] = {}
|
|
27
|
+
_IRIS_TO_MESSAGE_CLASS_CACHE: dict[str, type] = {}
|
|
30
28
|
_IRIS_PARAMETER_CACHE: dict[tuple[str, str], Optional[str]] = {}
|
|
31
29
|
_AUTO_SYNCED: set[tuple[type, str]] = set()
|
|
32
30
|
|
|
@@ -177,6 +175,7 @@ def register_persistent_message_class(
|
|
|
177
175
|
|
|
178
176
|
if sync_schema:
|
|
179
177
|
msg_cls.sync_schema()
|
|
178
|
+
_AUTO_SYNCED.add((msg_cls, iris_classname))
|
|
180
179
|
|
|
181
180
|
|
|
182
181
|
def serialize_persistent_message(
|
|
@@ -191,70 +190,55 @@ def serialize_persistent_message(
|
|
|
191
190
|
iris_classname = resolve_iris_classname(msg_cls)
|
|
192
191
|
_ensure_schema(msg_cls, iris_classname)
|
|
193
192
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
for field_name, model_field in msg_cls.__model_fields__.items():
|
|
200
|
-
if field_name not in message.__dict__:
|
|
201
|
-
continue
|
|
202
|
-
value = getattr(message, field_name)
|
|
203
|
-
materialized = _materialize_related_value(
|
|
204
|
-
runtime, model_field.declared_type, value
|
|
205
|
-
)
|
|
206
|
-
runtime.inject_iris_value(
|
|
207
|
-
iris_obj,
|
|
208
|
-
field_name,
|
|
209
|
-
materialized,
|
|
210
|
-
field_meta=model_field.field_info,
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
message._iris_obj = iris_obj
|
|
214
|
-
try:
|
|
215
|
-
obj_id = runtime.get_object_id(iris_obj)
|
|
216
|
-
if obj_id:
|
|
217
|
-
message._pk = str(obj_id)
|
|
218
|
-
except Exception:
|
|
219
|
-
pass
|
|
193
|
+
iris_obj = iris_persistence.materialize(
|
|
194
|
+
message,
|
|
195
|
+
auto_sync=False,
|
|
196
|
+
validate=False,
|
|
197
|
+
)
|
|
220
198
|
return iris_obj
|
|
221
199
|
|
|
222
200
|
|
|
223
|
-
def deserialize_persistent_message(
|
|
224
|
-
|
|
201
|
+
def deserialize_persistent_message(
|
|
202
|
+
serial: Any,
|
|
203
|
+
iris_classname: Optional[str] = None,
|
|
204
|
+
) -> Any:
|
|
205
|
+
iris_classname = iris_classname or get_iris_object_classname(serial)
|
|
225
206
|
if not iris_classname:
|
|
226
207
|
return serial
|
|
227
208
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
msg_cls = load_python_class(python_classname, python_classpath)
|
|
236
|
-
except (AttributeError, ModuleNotFoundError, PersistentMessageError) as exc:
|
|
237
|
-
if strict:
|
|
238
|
-
raise PersistentMessageError(
|
|
239
|
-
f"IRIS class {iris_classname!r} is marked as a PersistentMessage for "
|
|
240
|
-
f"Python class {python_classname!r}, but that Python class could not "
|
|
241
|
-
"be imported. Ensure the message class is importable, or register it "
|
|
242
|
-
"through CLASSES so migration writes IOP_PYTHON_CLASSPATH."
|
|
243
|
-
) from exc
|
|
244
|
-
return serial
|
|
245
|
-
|
|
246
|
-
if not is_persistent_message_class(msg_cls):
|
|
247
|
-
if strict:
|
|
248
|
-
raise PersistentMessageError(
|
|
249
|
-
f"IRIS class {iris_classname!r} maps to {python_classname!r}, "
|
|
250
|
-
"but that class is not a PersistentMessage subclass."
|
|
251
|
-
)
|
|
252
|
-
return serial
|
|
209
|
+
msg_cls = _IRIS_TO_MESSAGE_CLASS_CACHE.get(iris_classname)
|
|
210
|
+
if msg_cls is None:
|
|
211
|
+
python_classname, python_classpath, strict = _resolve_python_message_metadata(
|
|
212
|
+
iris_classname
|
|
213
|
+
)
|
|
214
|
+
if not python_classname:
|
|
215
|
+
return serial
|
|
253
216
|
|
|
254
|
-
|
|
217
|
+
try:
|
|
218
|
+
msg_cls = load_python_class(python_classname, python_classpath)
|
|
219
|
+
except (AttributeError, ModuleNotFoundError, PersistentMessageError) as exc:
|
|
220
|
+
if strict:
|
|
221
|
+
raise PersistentMessageError(
|
|
222
|
+
f"IRIS class {iris_classname!r} is marked as a PersistentMessage for "
|
|
223
|
+
f"Python class {python_classname!r}, but that Python class could not "
|
|
224
|
+
"be imported. Ensure the message class is importable, or register it "
|
|
225
|
+
"through CLASSES so migration writes IOP_PYTHON_CLASSPATH."
|
|
226
|
+
) from exc
|
|
227
|
+
return serial
|
|
228
|
+
|
|
229
|
+
if not is_persistent_message_class(msg_cls):
|
|
230
|
+
if strict:
|
|
231
|
+
raise PersistentMessageError(
|
|
232
|
+
f"IRIS class {iris_classname!r} maps to {python_classname!r}, "
|
|
233
|
+
"but that class is not a PersistentMessage subclass."
|
|
234
|
+
)
|
|
235
|
+
return serial
|
|
236
|
+
|
|
237
|
+
_prepare_message_class(msg_cls, iris_classname, registered=False)
|
|
238
|
+
_IRIS_TO_MESSAGE_CLASS_CACHE[iris_classname] = msg_cls
|
|
255
239
|
|
|
256
240
|
known_pk = _safe_get_object_id(serial)
|
|
257
|
-
return
|
|
241
|
+
return msg_cls.from_iris(serial, known_pk=known_pk or "")
|
|
258
242
|
|
|
259
243
|
|
|
260
244
|
def resolve_iris_classname(msg_cls: type) -> str:
|
|
@@ -351,6 +335,9 @@ def _safe_get_object_id(obj: Any) -> Optional[str]:
|
|
|
351
335
|
|
|
352
336
|
|
|
353
337
|
def _ensure_schema(msg_cls: type, iris_classname: str) -> None:
|
|
338
|
+
key = (msg_cls, iris_classname)
|
|
339
|
+
if key in _AUTO_SYNCED:
|
|
340
|
+
return
|
|
354
341
|
if not getattr(msg_cls, "_auto_sync", False):
|
|
355
342
|
return
|
|
356
343
|
if getattr(msg_cls, "_sync_mode", DEFAULT_SYNC_MODE) != DEFAULT_SYNC_MODE:
|
|
@@ -360,10 +347,6 @@ def _ensure_schema(msg_cls: type, iris_classname: str) -> None:
|
|
|
360
347
|
"with mode='extend'."
|
|
361
348
|
)
|
|
362
349
|
|
|
363
|
-
key = (msg_cls, iris_classname)
|
|
364
|
-
if key in _AUTO_SYNCED:
|
|
365
|
-
return
|
|
366
|
-
|
|
367
350
|
_prepare_message_class(msg_cls, iris_classname, registered=False)
|
|
368
351
|
msg_cls.sync_schema()
|
|
369
352
|
_AUTO_SYNCED.add(key)
|
|
@@ -381,6 +364,7 @@ def _prepare_message_class(
|
|
|
381
364
|
msg_cls._iop_registered_classname = iris_classname
|
|
382
365
|
_set_message_parameters(msg_cls)
|
|
383
366
|
_cache_mapping(get_python_classname(msg_cls), iris_classname)
|
|
367
|
+
_IRIS_TO_MESSAGE_CLASS_CACHE[iris_classname] = msg_cls
|
|
384
368
|
|
|
385
369
|
|
|
386
370
|
def _set_message_parameters(msg_cls: type) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.1b5
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -43,8 +43,8 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
License-File: LICENSE
|
|
44
44
|
Requires-Dist: pydantic>=2.0.0
|
|
45
45
|
Requires-Dist: xmltodict>=0.12.0
|
|
46
|
-
Requires-Dist: iris-embedded-python-wrapper>=0.0
|
|
47
|
-
Requires-Dist: iris-persistence>=0.1.
|
|
46
|
+
Requires-Dist: iris-embedded-python-wrapper>=0.5.0
|
|
47
|
+
Requires-Dist: iris-persistence>=0.1.1
|
|
48
48
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
49
49
|
Requires-Dist: debugpy>=1.8.0
|
|
50
50
|
Requires-Dist: requests>=2.24.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/__init__.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_cli.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_common.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_director.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/grongier/pex/_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_async_request.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_host.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_operation.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_process.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_business_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_director_protocol.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_generator_request.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_inbound_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_log_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_message_validator.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_outbound_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/_serialization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Common.cls
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Director.cls
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Message.cls
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Projection.cls
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Test.cls
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Utils.cls
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/cls/IOP/Wrapper.cls
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.7.1b3 → iris_pex_embedded_python-3.7.1b5}/src/iop/wsgi/handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|