iris-pex-embedded-python 3.4.1b8__tar.gz → 3.4.1b10__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.
Potentially problematic release.
This version of iris-pex-embedded-python might be problematic. Click here for more details.
- {iris_pex_embedded_python-3.4.1b8/src/iris_pex_embedded_python.egg-info → iris_pex_embedded_python-3.4.1b10}/PKG-INFO +2 -1
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/pyproject.toml +3 -2
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_service.py +6 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_common.py +9 -0
- iris_pex_embedded_python-3.4.1b10/src/iop/_debugpy.py +145 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Common.cls +3 -1
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Utils.cls +59 -9
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10/src/iris_pex_embedded_python.egg-info}/PKG-INFO +2 -1
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +1 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iris_pex_embedded_python.egg-info/requires.txt +1 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/LICENSE +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/README.md +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/setup.cfg +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/setup.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_business_host.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_common.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_director.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_utils.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/__init__.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/__main__.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_async_request.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_host.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_operation.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_process.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_cli.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_decorators.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_director.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_dispatch.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_inbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_iris.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_log_manager.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_message.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_message_validator.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_outbound_adapter.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_private_session_duplex.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_private_session_process.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_serialization.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_utils.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/BusinessProcess.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/BusinessService.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Director.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Message.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PickleMessage.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Test.cls +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/wsgi/handlers.py +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
- {iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/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.4.
|
|
3
|
+
Version: 3.4.1b10
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -49,6 +49,7 @@ Requires-Dist: xmltodict>=0.12.0
|
|
|
49
49
|
Requires-Dist: iris-embedded-python-wrapper>=0.0.6
|
|
50
50
|
Requires-Dist: setuptools>=40.8.0
|
|
51
51
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
52
|
+
Requires-Dist: debugpy>=1.8.0
|
|
52
53
|
Dynamic: license-file
|
|
53
54
|
|
|
54
55
|
# IoP (Interoperability On Python)
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "iris_pex_embedded_python"
|
|
6
|
-
version = "3.4.
|
|
6
|
+
version = "3.4.1b10"
|
|
7
7
|
description = "Iris Interoperability based on Embedded Python"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
authors = [
|
|
@@ -31,7 +31,8 @@ dependencies = [
|
|
|
31
31
|
"xmltodict>=0.12.0",
|
|
32
32
|
"iris-embedded-python-wrapper>=0.0.6",
|
|
33
33
|
"setuptools>=40.8.0",
|
|
34
|
-
"jsonpath-ng>=1.7.0"
|
|
34
|
+
"jsonpath-ng>=1.7.0",
|
|
35
|
+
"debugpy>=1.8.0",
|
|
35
36
|
]
|
|
36
37
|
|
|
37
38
|
license = { file = "LICENSE" }
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_service.py
RENAMED
|
@@ -16,6 +16,12 @@ class _BusinessService(_BusinessHost):
|
|
|
16
16
|
Adapter = adapter = None
|
|
17
17
|
_wait_for_next_call_interval = False
|
|
18
18
|
|
|
19
|
+
def _dispatch_on_init(self, host_object) -> None:
|
|
20
|
+
"""For internal use only."""
|
|
21
|
+
self.on_init()
|
|
22
|
+
|
|
23
|
+
return
|
|
24
|
+
|
|
19
25
|
def on_process_input(self, message_input):
|
|
20
26
|
""" Receives the message from the inbond adapter via the PRocessInput method and is responsible for forwarding it to target business processes or operations.
|
|
21
27
|
If the business service does not specify an adapter, then the default adapter calls this method with no message
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
import inspect
|
|
3
3
|
import traceback
|
|
4
|
+
|
|
4
5
|
from typing import Any, ClassVar, List, Optional, Tuple
|
|
5
6
|
|
|
6
7
|
from . import _iris
|
|
7
8
|
|
|
8
9
|
from iop._log_manager import LogManager, logging
|
|
9
10
|
|
|
11
|
+
from iop._debugpy import debugpython
|
|
12
|
+
|
|
10
13
|
class _Common(metaclass=abc.ABCMeta):
|
|
11
14
|
"""Base class that defines common methods for all component types.
|
|
12
15
|
|
|
@@ -57,6 +60,7 @@ class _Common(metaclass=abc.ABCMeta):
|
|
|
57
60
|
self.on_connected()
|
|
58
61
|
|
|
59
62
|
def _dispatch_on_init(self, host_object: Any) -> None:
|
|
63
|
+
"""Initialize component when started."""
|
|
60
64
|
self.on_init()
|
|
61
65
|
|
|
62
66
|
def _dispatch_on_tear_down(self, host_object: Any) -> None:
|
|
@@ -66,6 +70,11 @@ class _Common(metaclass=abc.ABCMeta):
|
|
|
66
70
|
"""Internal method to set IRIS handles."""
|
|
67
71
|
pass
|
|
68
72
|
|
|
73
|
+
def _debugpy(self, host) -> None:
|
|
74
|
+
"""Set up debugpy for debugging."""
|
|
75
|
+
if debugpython is not None:
|
|
76
|
+
debugpython(self=self, host_object=host)
|
|
77
|
+
|
|
69
78
|
# Component information methods
|
|
70
79
|
@classmethod
|
|
71
80
|
def _get_info(cls) -> List[str]:
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
|
|
2
|
+
import threading
|
|
3
|
+
import time
|
|
4
|
+
import contextlib
|
|
5
|
+
import socket
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
from contextlib import closing
|
|
9
|
+
from typing import Optional, cast, Any, Dict
|
|
10
|
+
|
|
11
|
+
def find_free_port(start: Optional[int] = None, end: Optional[int] = None) -> int:
|
|
12
|
+
port = start
|
|
13
|
+
if port is None:
|
|
14
|
+
port = 0
|
|
15
|
+
if end is None:
|
|
16
|
+
end = port
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
|
|
20
|
+
with contextlib.suppress(Exception):
|
|
21
|
+
s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
|
|
22
|
+
|
|
23
|
+
s.bind(("0.0.0.0", port))
|
|
24
|
+
|
|
25
|
+
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
26
|
+
return cast(int, s.getsockname()[1])
|
|
27
|
+
except (SystemExit, KeyboardInterrupt):
|
|
28
|
+
raise
|
|
29
|
+
except BaseException:
|
|
30
|
+
if port and end > port:
|
|
31
|
+
return find_free_port(port + 1, end)
|
|
32
|
+
if start and start > 0:
|
|
33
|
+
return find_free_port(None)
|
|
34
|
+
raise
|
|
35
|
+
|
|
36
|
+
def is_debugpy_installed() -> bool:
|
|
37
|
+
try:
|
|
38
|
+
__import__("debugpy")
|
|
39
|
+
return True
|
|
40
|
+
except ImportError:
|
|
41
|
+
return False
|
|
42
|
+
|
|
43
|
+
def _get_python_interpreter_path(install_dir: Optional[str]) -> Optional[str]:
|
|
44
|
+
"""Get the path to the Python interpreter."""
|
|
45
|
+
if not install_dir:
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
python_exe = 'irispython.exe' if sys.platform == 'win32' else 'irispython'
|
|
49
|
+
python_path = os.path.join(install_dir, 'bin', python_exe)
|
|
50
|
+
|
|
51
|
+
return python_path if os.path.exists(python_path) else None
|
|
52
|
+
|
|
53
|
+
def _get_debugpy_config(python_path: str) -> Dict[str, str]:
|
|
54
|
+
"""Get the debugpy configuration."""
|
|
55
|
+
return {"python": python_path}
|
|
56
|
+
|
|
57
|
+
def configure_debugpy(self, python_path: Optional[str] = None) -> bool:
|
|
58
|
+
"""Configure debugpy with the appropriate Python interpreter."""
|
|
59
|
+
import debugpy
|
|
60
|
+
|
|
61
|
+
if not python_path:
|
|
62
|
+
install_dir = os.environ.get('IRISINSTALLDIR') or os.environ.get('ISC_PACKAGE_INSTALLDIR')
|
|
63
|
+
python_path = _get_python_interpreter_path(install_dir)
|
|
64
|
+
|
|
65
|
+
if not python_path:
|
|
66
|
+
self.log_alert("Could not determine Python interpreter path")
|
|
67
|
+
return False
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
debugpy.configure(_get_debugpy_config(python_path))
|
|
71
|
+
self.log_info(f"Debugpy configured with Python interpreter: {python_path}")
|
|
72
|
+
return True
|
|
73
|
+
except Exception as e:
|
|
74
|
+
self.log_alert(f"Failed to configure debugpy: {e}")
|
|
75
|
+
return False
|
|
76
|
+
|
|
77
|
+
def wait_for_debugpy_connected(timeout: float = 30, port: int = 0) -> bool:
|
|
78
|
+
"""Wait for debugpy client to connect."""
|
|
79
|
+
import debugpy
|
|
80
|
+
|
|
81
|
+
if not is_debugpy_installed():
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
def timeout_handler():
|
|
85
|
+
time.sleep(timeout)
|
|
86
|
+
debugpy.wait_for_client.cancel()
|
|
87
|
+
|
|
88
|
+
threading.Thread(target=timeout_handler, daemon=True).start()
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
debugpy.wait_for_client()
|
|
92
|
+
return debugpy.is_client_connected()
|
|
93
|
+
except Exception:
|
|
94
|
+
import pydevd # type: ignore
|
|
95
|
+
pydevd.stoptrace()
|
|
96
|
+
return False
|
|
97
|
+
|
|
98
|
+
def enable_debugpy(port: int, address: str = "0.0.0.0") -> None:
|
|
99
|
+
"""Enable debugpy server on specified port and address."""
|
|
100
|
+
import debugpy
|
|
101
|
+
debugpy.listen((address, port))
|
|
102
|
+
|
|
103
|
+
def debugpython(self, host_object: Any) -> None:
|
|
104
|
+
"""Enable and configure debugpy for debugging purposes."""
|
|
105
|
+
# hack to set __file__ for os module in debugpy
|
|
106
|
+
# This is a workaround for the issue where debugpy cannot find the __file__ attribute of the os module.
|
|
107
|
+
if not hasattr(os, '__file__'):
|
|
108
|
+
setattr(os, '__file__', __file__)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
if host_object is None:
|
|
112
|
+
self.log_alert("No host object found, cannot enable debugpy.")
|
|
113
|
+
return
|
|
114
|
+
|
|
115
|
+
if host_object.enable != 1:
|
|
116
|
+
self.log_info("Debugpy is not enabled.")
|
|
117
|
+
return
|
|
118
|
+
|
|
119
|
+
if not is_debugpy_installed():
|
|
120
|
+
self.log_alert("Debugpy is not installed.")
|
|
121
|
+
return
|
|
122
|
+
|
|
123
|
+
# Configure Python interpreter
|
|
124
|
+
if host_object.PythonInterpreterPath != '':
|
|
125
|
+
success = configure_debugpy(self, host_object.PythonInterpreterPath)
|
|
126
|
+
else:
|
|
127
|
+
success = configure_debugpy(self)
|
|
128
|
+
|
|
129
|
+
if not success:
|
|
130
|
+
return
|
|
131
|
+
|
|
132
|
+
# Setup debugging server
|
|
133
|
+
port = host_object.port if host_object.port and host_object.port > 0 else find_free_port()
|
|
134
|
+
|
|
135
|
+
try:
|
|
136
|
+
enable_debugpy(port=port)
|
|
137
|
+
self.log_info(f"Debugpy enabled on port {port}")
|
|
138
|
+
|
|
139
|
+
self.trace(f"Waiting {host_object.timeout} seconds for debugpy connection...")
|
|
140
|
+
if wait_for_debugpy_connected(timeout=host_object.timeout, port=port):
|
|
141
|
+
self.log_info("Debugpy connected successfully")
|
|
142
|
+
else:
|
|
143
|
+
self.log_alert(f"Debugpy connection timed out after {host_object.timeout} seconds")
|
|
144
|
+
except Exception as e:
|
|
145
|
+
self.log_alert(f"Error enabling debugpy: {e}")
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Common.cls
RENAMED
|
@@ -40,7 +40,9 @@ Method GetModule() As %String
|
|
|
40
40
|
Method %OnNew(pConfigName As %String) As %Status
|
|
41
41
|
{
|
|
42
42
|
$$$ThrowOnError(..Connect())
|
|
43
|
-
|
|
43
|
+
$$$ThrowOnError($method($this,"initConfig",.pConfigName)) ; call subclass
|
|
44
|
+
do ..%class."_debugpy"($this)
|
|
45
|
+
Quit $$$OK
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
Method OnInit() As %Status
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Utils.cls
RENAMED
|
@@ -61,7 +61,7 @@ ClassMethod DeleteComponentProxy(pClassname As %String = "") As %Status
|
|
|
61
61
|
{
|
|
62
62
|
#dim tSC As %Status = $$$OK
|
|
63
63
|
#dim ex As %Exception.AbstractException
|
|
64
|
-
#dim
|
|
64
|
+
#dim tIsIOP As %Boolean = 0
|
|
65
65
|
#dim tClass As %Dictionary.CompiledClass
|
|
66
66
|
|
|
67
67
|
Quit:(""=pClassname) $$$ERROR($$$EnsErrGeneral,"Remote class name must be specified.")
|
|
@@ -79,16 +79,16 @@ ClassMethod DeleteComponentProxy(pClassname As %String = "") As %Status
|
|
|
79
79
|
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Proxy class for remote class '%1' could not be opened.",pClassname))
|
|
80
80
|
Quit
|
|
81
81
|
}
|
|
82
|
-
Set
|
|
82
|
+
Set tIsIOP = ("IOP.Utils" = tClass.GeneratedBy)
|
|
83
83
|
}
|
|
84
|
-
If
|
|
84
|
+
If tIsIOP {
|
|
85
85
|
Set tSC = ##class(%Dictionary.ClassDefinition).%DeleteId(pClassname)
|
|
86
86
|
If $$$ISERR(tSC) {
|
|
87
87
|
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Unable to delete proxy class for remote class '%1' : '%2'.",pClassname,$System.Status.GetErrorText(tSC)))
|
|
88
88
|
Quit
|
|
89
89
|
}
|
|
90
90
|
} Else {
|
|
91
|
-
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot delete class '%1' because it is not a
|
|
91
|
+
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot delete class '%1' because it is not a IOP proxy class.",pClassname))
|
|
92
92
|
Quit
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -179,23 +179,23 @@ ClassMethod GenerateProxyClass(
|
|
|
179
179
|
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Proxy class '%1' already exists.",pClassname))
|
|
180
180
|
Quit
|
|
181
181
|
} Else {
|
|
182
|
-
#dim
|
|
182
|
+
#dim tIsIOP As %Boolean = 0
|
|
183
183
|
If $classmethod(pClassname,"%Extends","IOP.Common") {
|
|
184
184
|
#dim tClass As %Dictionary.CompiledClass = ##class(%Dictionary.CompiledClass).%OpenId(pClassname)
|
|
185
185
|
If '$IsObject(tClass) {
|
|
186
186
|
Set tSC = $$$ERROR($$$EnsErrGeneral,"Class not found")
|
|
187
187
|
Quit
|
|
188
188
|
}
|
|
189
|
-
Set
|
|
189
|
+
Set tIsIOP = ("IOP.Utils" = tClass.GeneratedBy)
|
|
190
190
|
}
|
|
191
|
-
If
|
|
191
|
+
If tIsIOP {
|
|
192
192
|
Set tSC = ##class(%Dictionary.ClassDefinition).%DeleteId(pClassname)
|
|
193
193
|
If $$$ISERR(tSC) {
|
|
194
194
|
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Unable to delete existing proxy class '%1' : '%2'.",pClassname,$System.Status.GetErrorText(tSC)))
|
|
195
195
|
Quit
|
|
196
196
|
}
|
|
197
197
|
} Else {
|
|
198
|
-
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot overwrite class '%1' because it is not a
|
|
198
|
+
Set tSC = $$$ERROR($$$EnsErrGeneral,$$$FormatText("Cannot overwrite class '%1' because it is not a IOP proxy class.",pClassname))
|
|
199
199
|
Quit
|
|
200
200
|
}
|
|
201
201
|
}
|
|
@@ -208,7 +208,7 @@ ClassMethod GenerateProxyClass(
|
|
|
208
208
|
|
|
209
209
|
#dim tSuperClass As %String = pClassDetails."__getitem__"(0)
|
|
210
210
|
If (""=tSuperClass) {
|
|
211
|
-
Set tSC = $$$ERROR($$$EnsErrGeneral,"No
|
|
211
|
+
Set tSC = $$$ERROR($$$EnsErrGeneral,"No IOP superclass found.")
|
|
212
212
|
Quit
|
|
213
213
|
}
|
|
214
214
|
If '$Case($P(tSuperClass,".",*),"DuplexProcess":1,"DuplexService":1,"DuplexOperation":1,"InboundAdapter":1,"OutboundAdapter":1,"BusinessService":1,"BusinessProcess":1,"BusinessOperation":1,:0) {
|
|
@@ -323,6 +323,56 @@ ClassMethod GenerateProxyClass(
|
|
|
323
323
|
}
|
|
324
324
|
Quit:$$$ISERR(tSC)
|
|
325
325
|
|
|
326
|
+
#; Add debug settings, three settings are always available debug a boolean, port an integer and a timeout an integer
|
|
327
|
+
Set tPropCat = "Python Debug"
|
|
328
|
+
#; Debug property
|
|
329
|
+
Set tPropDebug = ##class(%Dictionary.PropertyDefinition).%New()
|
|
330
|
+
Set tPropDebug.Name = "enable"
|
|
331
|
+
Set tPropDebug.Type = "%Boolean"
|
|
332
|
+
Set tPropDebug.InitialExpression = $$$quote(0)
|
|
333
|
+
Set tPropDebug.Description = "Enable or disable debug"
|
|
334
|
+
|
|
335
|
+
Set tSC = tCOSClass.Properties.Insert(tPropDebug)
|
|
336
|
+
Quit:$$$ISERR(tSC)
|
|
337
|
+
|
|
338
|
+
#; Add the settings parameter
|
|
339
|
+
Set tSETTINGSParamValue = tSETTINGSParamValue_",enable:"_tPropCat
|
|
340
|
+
|
|
341
|
+
#; Port property
|
|
342
|
+
Set tPropPort = ##class(%Dictionary.PropertyDefinition).%New()
|
|
343
|
+
Set tPropPort.Name = "port"
|
|
344
|
+
Set tPropPort.Type = "%Integer"
|
|
345
|
+
Set tPropPort.InitialExpression = $$$quote(0)
|
|
346
|
+
Set tPropPort.Description = "Port to use for the debug connection, if 0 an random port will be used"
|
|
347
|
+
Set tSC = tCOSClass.Properties.Insert(tPropPort)
|
|
348
|
+
Quit:$$$ISERR(tSC)
|
|
349
|
+
|
|
350
|
+
#; Add the settings parameter
|
|
351
|
+
Set tSETTINGSParamValue = tSETTINGSParamValue_",port:"_tPropCat
|
|
352
|
+
|
|
353
|
+
#; Timeout property
|
|
354
|
+
Set tPropTimeout = ##class(%Dictionary.PropertyDefinition).%New()
|
|
355
|
+
Set tPropTimeout.Name = "timeout"
|
|
356
|
+
Set tPropTimeout.Type = "%Integer"
|
|
357
|
+
Set tPropTimeout.InitialExpression = $$$quote(30)
|
|
358
|
+
Set tSC = tCOSClass.Properties.Insert(tPropTimeout)
|
|
359
|
+
Quit:$$$ISERR(tSC)
|
|
360
|
+
|
|
361
|
+
#; Add the settings parameter
|
|
362
|
+
Set tSETTINGSParamValue = tSETTINGSParamValue_",timeout:"_tPropCat
|
|
363
|
+
|
|
364
|
+
#; PythonInterpreterPath property
|
|
365
|
+
Set tPropInterpre = ##class(%Dictionary.PropertyDefinition).%New()
|
|
366
|
+
Set tPropInterpre.Name = "PythonInterpreterPath"
|
|
367
|
+
Set tPropInterpre.Type = "%String"
|
|
368
|
+
Set tPropInterpre.Description = "Path to the Python interpreter, if not set the default one will be used"
|
|
369
|
+
Do tPropInterpre.Parameters.SetAt("255","MAXLEN")
|
|
370
|
+
Set tSC = tCOSClass.Properties.Insert(tPropInterpre)
|
|
371
|
+
Quit:$$$ISERR(tSC)
|
|
372
|
+
|
|
373
|
+
#; Add the settings parameter
|
|
374
|
+
Set tSETTINGSParamValue = tSETTINGSParamValue_",PythonInterpreterPath:"_tPropCat
|
|
375
|
+
|
|
326
376
|
#dim tSETTINGSParam As %Dictionary.ParameterDefinition = ##class(%Dictionary.ParameterDefinition).%New()
|
|
327
377
|
Set tSETTINGSParam.Name = "SETTINGS"
|
|
328
378
|
Set tSETTINGSParam.Default = tSETTINGSParamValue
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iris_pex_embedded_python
|
|
3
|
-
Version: 3.4.
|
|
3
|
+
Version: 3.4.1b10
|
|
4
4
|
Summary: Iris Interoperability based on Embedded Python
|
|
5
5
|
Author-email: grongier <guillaume.rongier@intersystems.com>
|
|
6
6
|
License: MIT License
|
|
@@ -49,6 +49,7 @@ Requires-Dist: xmltodict>=0.12.0
|
|
|
49
49
|
Requires-Dist: iris-embedded-python-wrapper>=0.0.6
|
|
50
50
|
Requires-Dist: setuptools>=40.8.0
|
|
51
51
|
Requires-Dist: jsonpath-ng>=1.7.0
|
|
52
|
+
Requires-Dist: debugpy>=1.8.0
|
|
52
53
|
Dynamic: license-file
|
|
53
54
|
|
|
54
55
|
# IoP (Interoperability On Python)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/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.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/__init__.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_cli.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_common.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_director.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/grongier/pex/_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_async_request.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_host.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_business_process.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_inbound_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_log_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_message_validator.py
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/_outbound_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/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.4.1b8 → iris_pex_embedded_python-3.4.1b10}/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
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/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
|
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/cls/IOP/Test.cls
RENAMED
|
File without changes
|
{iris_pex_embedded_python-3.4.1b8 → iris_pex_embedded_python-3.4.1b10}/src/iop/wsgi/handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|