iris-pex-embedded-python 3.4.4b6__tar.gz → 3.5.0b2__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.

Files changed (86) hide show
  1. {iris_pex_embedded_python-3.4.4b6/src/iris_pex_embedded_python.egg-info → iris_pex_embedded_python-3.5.0b2}/PKG-INFO +1 -1
  2. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/pyproject.toml +1 -1
  3. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_utils.py +30 -4
  4. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/BusinessProcess.cls +12 -0
  5. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Common.cls +42 -0
  6. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Utils.cls +88 -7
  7. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2/src/iris_pex_embedded_python.egg-info}/PKG-INFO +1 -1
  8. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/LICENSE +0 -0
  9. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/README.md +0 -0
  10. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/setup.cfg +0 -0
  11. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/setup.py +0 -0
  12. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/__init__.py +0 -0
  13. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/BusinessOperation.cls +0 -0
  14. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/BusinessProcess.cls +0 -0
  15. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/BusinessService.cls +0 -0
  16. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Common.cls +0 -0
  17. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Director.cls +0 -0
  18. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Duplex/Operation.cls +0 -0
  19. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Duplex/Process.cls +0 -0
  20. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Duplex/Service.cls +0 -0
  21. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/InboundAdapter.cls +0 -0
  22. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Message.cls +0 -0
  23. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/OutboundAdapter.cls +0 -0
  24. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PickleMessage.cls +0 -0
  25. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PrivateSession/Duplex.cls +0 -0
  26. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Ack.cls +0 -0
  27. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Poll.cls +0 -0
  28. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Start.cls +0 -0
  29. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/PrivateSession/Message/Stop.cls +0 -0
  30. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Test.cls +0 -0
  31. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/PEX/Utils.cls +0 -0
  32. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/cls/Grongier/Service/WSGI.cls +0 -0
  33. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/__init__.py +0 -0
  34. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/__main__.py +0 -0
  35. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/_business_host.py +0 -0
  36. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/_cli.py +0 -0
  37. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/_common.py +0 -0
  38. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/_director.py +0 -0
  39. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/_utils.py +0 -0
  40. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/grongier/pex/wsgi/handlers.py +0 -0
  41. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/__init__.py +0 -0
  42. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/__main__.py +0 -0
  43. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_async_request.py +0 -0
  44. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_business_host.py +0 -0
  45. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_business_operation.py +0 -0
  46. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_business_process.py +0 -0
  47. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_business_service.py +0 -0
  48. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_cli.py +0 -0
  49. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_common.py +0 -0
  50. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_debugpy.py +0 -0
  51. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_decorators.py +0 -0
  52. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_director.py +0 -0
  53. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_dispatch.py +0 -0
  54. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_inbound_adapter.py +0 -0
  55. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_iris.py +0 -0
  56. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_log_manager.py +0 -0
  57. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_message.py +0 -0
  58. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_message_validator.py +0 -0
  59. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_outbound_adapter.py +0 -0
  60. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_private_session_duplex.py +0 -0
  61. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_private_session_process.py +0 -0
  62. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/_serialization.py +0 -0
  63. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/BusinessOperation.cls +0 -0
  64. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/BusinessService.cls +0 -0
  65. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Director.cls +0 -0
  66. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Duplex/Operation.cls +0 -0
  67. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Duplex/Process.cls +0 -0
  68. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Duplex/Service.cls +0 -0
  69. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/InboundAdapter.cls +0 -0
  70. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Message/JSONSchema.cls +0 -0
  71. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Message.cls +0 -0
  72. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/OutboundAdapter.cls +0 -0
  73. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PickleMessage.cls +0 -0
  74. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PrivateSession/Duplex.cls +0 -0
  75. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PrivateSession/Message/Ack.cls +0 -0
  76. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PrivateSession/Message/Poll.cls +0 -0
  77. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PrivateSession/Message/Start.cls +0 -0
  78. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/PrivateSession/Message/Stop.cls +0 -0
  79. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Service/WSGI.cls +0 -0
  80. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/cls/IOP/Test.cls +0 -0
  81. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iop/wsgi/handlers.py +0 -0
  82. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iris_pex_embedded_python.egg-info/SOURCES.txt +0 -0
  83. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iris_pex_embedded_python.egg-info/dependency_links.txt +0 -0
  84. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iris_pex_embedded_python.egg-info/entry_points.txt +0 -0
  85. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/src/iris_pex_embedded_python.egg-info/requires.txt +0 -0
  86. {iris_pex_embedded_python-3.4.4b6 → iris_pex_embedded_python-3.5.0b2}/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.4b6
3
+ Version: 3.5.0b2
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "iris_pex_embedded_python"
6
- version = "3.4.4b6"
6
+ version = "3.5.0b2"
7
7
  description = "Iris Interoperability based on Embedded Python"
8
8
  readme = "README.md"
9
9
  authors = [
@@ -1,12 +1,12 @@
1
1
  import os
2
2
  import sys
3
- import ast
4
- import inspect
5
3
  import importlib
6
4
  import importlib.util
7
5
  import importlib.resources
8
6
  import json
9
- from typing import Any, Dict, Optional, Union
7
+ import inspect
8
+ import ast
9
+ from typing import Any, Dict, Optional, Union, Tuple
10
10
 
11
11
  import xmltodict
12
12
  from pydantic import TypeAdapter
@@ -80,6 +80,31 @@ class _Utils():
80
80
  """
81
81
  _Utils.raise_on_error(_iris.get_iris().cls('IOP.Message.JSONSchema').Import(schema_str,categories,schema_name))
82
82
 
83
+ @staticmethod
84
+ def get_python_settings() -> Tuple[str,str,str]:
85
+ import iris_utils._cli
86
+
87
+ pythonlib = iris_utils._cli.find_libpython()
88
+ pythonpath = _Utils._get_python_path()
89
+ pythonversion = sys.version[:4]
90
+
91
+ if not pythonlib:
92
+ pythonlib = ""
93
+
94
+ return pythonlib, pythonpath, pythonversion
95
+
96
+ @staticmethod
97
+ def _get_python_path() -> str:
98
+
99
+ if "VIRTUAL_ENV" in os.environ:
100
+ return os.path.join(
101
+ os.environ["VIRTUAL_ENV"],
102
+ "lib",
103
+ f"python{sys.version[:4]}",
104
+ "site-packages"
105
+ )
106
+ return ""
107
+
83
108
  @staticmethod
84
109
  def register_component(module:str,classname:str,path:str,overwrite:int=1,iris_classname:str='Python'):
85
110
  """
@@ -99,8 +124,9 @@ class _Utils():
99
124
  """
100
125
  path = os.path.abspath(os.path.normpath(path))
101
126
  fullpath = _Utils.guess_path(module,path)
127
+ pythonlib, pythonpath, pythonversion = _Utils.get_python_settings()
102
128
  try:
103
- _iris.get_iris().cls('IOP.Utils').dispatchRegisterComponent(module,classname,path,fullpath,overwrite,iris_classname)
129
+ _iris.get_iris().cls('IOP.Utils').dispatchRegisterComponent(module,classname,path,fullpath,overwrite,iris_classname,pythonlib,pythonpath,pythonversion)
104
130
  except RuntimeError as e:
105
131
  # New message error : Make sure the iop package is installed in iris
106
132
  raise RuntimeError("Iris class : IOP.Utils not found. Make sure the iop package is installed in iris eg: iop --init.") from e
@@ -131,6 +131,18 @@ Storage Default
131
131
  <Value name="10">
132
132
  <Value>%traceback</Value>
133
133
  </Value>
134
+ <Value name="11">
135
+ <Value>%PythonPath</Value>
136
+ </Value>
137
+ <Value name="12">
138
+ <Value>%PythonRuntimeLibrary</Value>
139
+ </Value>
140
+ <Value name="13">
141
+ <Value>%PythonRuntimeLibraryVersion</Value>
142
+ </Value>
143
+ <Value name="14">
144
+ <Value>%Venv</Value>
145
+ </Value>
134
146
  </Data>
135
147
  <Data name="persistentProperties">
136
148
  <Attribute>persistentProperties</Attribute>
@@ -29,6 +29,14 @@ Property %PythonInterpreterPath As %String(MAXLEN = 255);
29
29
 
30
30
  Property %traceback As %Boolean [ InitialExpression = 1 ];
31
31
 
32
+ Property %Venv As %Boolean [ InitialExpression = 0 ];
33
+
34
+ Property %PythonPath As %String(MAXLEN = 255);
35
+
36
+ Property %PythonRuntimeLibrary As %String(MAXLEN = 255);
37
+
38
+ Property %PythonRuntimeLibraryVersion As %String;
39
+
32
40
  /// Get Class
33
41
  Method GetClass() As %SYS.Python
34
42
  {
@@ -78,18 +86,47 @@ Method DisplayTraceback(ex) As %Status
78
86
  Method OnInit() As %Status
79
87
  {
80
88
  set tSC = $$$OK
89
+
81
90
  try {
91
+ LOCK +^PythonSettings:5
92
+
93
+ if ..%Venv {
94
+ $$$ThrowOnError(##class(IOP.Utils).SetPythonSettings(..%PythonRuntimeLibrary, ..%PythonPath, ..%PythonRuntimeLibraryVersion))
95
+ }
96
+
97
+ do ..DisplayPythonVersion()
98
+
82
99
  do $system.Python.Debugging(..%traceback)
100
+
83
101
  $$$ThrowOnError(..Connect())
102
+ LOCK -^PythonSettings
103
+
84
104
  do ..%class."_debugpy"($this)
105
+
85
106
  do ..%class."_dispatch_on_init"($this)
86
107
  } catch ex {
87
108
 
88
109
  set tSC = ..DisplayTraceback(ex)
89
110
  }
111
+ LOCK -^PythonSettings
90
112
  quit tSC
91
113
  }
92
114
 
115
+ Method DisplayPythonVersion()
116
+ {
117
+ set sys = ##class(%SYS.Python).Import("sys")
118
+ set version = sys.version
119
+ set versionInfo = sys."version_info"
120
+ set major = versionInfo.major
121
+ set minor = versionInfo.minor
122
+ set micro = versionInfo.micro
123
+ set releaseLevel = versionInfo.releaselevel
124
+ set serial = versionInfo.serial
125
+
126
+ $$$LOGINFO("Python Version: "_ version)
127
+ $$$LOGINFO("Version Info: "_ major_ "."_ minor_ "."_ micro_" ("_ releaseLevel_ ", "_serial_ ")")
128
+ }
129
+
93
130
  ClassMethod SetPythonPath(pClasspaths)
94
131
  {
95
132
  set sys = ##class(%SYS.Python).Import("sys")
@@ -196,6 +233,11 @@ Method SetPropertyValues()
196
233
  set tSQL = tSQL _ " and name <> '%port'"
197
234
  set tSQL = tSQL _ " and name <> '%PythonInterpreterPath'"
198
235
  set tSQL = tSQL _ " and name <> '%traceback'"
236
+ set tSQL = tSQL _ " and name <> '%PythonPath'"
237
+ set tSQL = tSQL _ " and name <> '%PythonRuntimeLibrary'"
238
+ set tSQL = tSQL _ " and name <> '%PythonRuntimeLibraryVersion'"
239
+ set tSQL = tSQL _ " and name <> '%settings'"
240
+ set tSQL = tSQL _ " and name <> '%Venv'"
199
241
 
200
242
  set tStmt = ##class(%SQL.Statement).%New()
201
243
 
@@ -13,10 +13,13 @@ ClassMethod dispatchRegisterComponent(
13
13
  pCLASSPATHS As %String = "",
14
14
  pFullpath As %String = "",
15
15
  pOverwrite As %Boolean = 0,
16
- pProxyClassname As %String = "") As %Status
16
+ pProxyClassname As %String = "",
17
+ pPythonLib,
18
+ pPythonPath,
19
+ pPythonVersion) As %Status
17
20
  {
18
21
  set tSc = $$$OK
19
- $$$ThrowOnError(##class(IOP.Utils).RegisterComponent(pModule, pRemoteClassname, pCLASSPATHS, pFullpath, pOverwrite , pProxyClassname))
22
+ $$$ThrowOnError(##class(IOP.Utils).RegisterComponent(pModule, pRemoteClassname, pCLASSPATHS, pFullpath, pOverwrite , pProxyClassname,pPythonLib, pPythonPath, pPythonVersion))
20
23
  return tSc
21
24
  }
22
25
 
@@ -27,7 +30,10 @@ ClassMethod RegisterComponent(
27
30
  pCLASSPATHS As %String = "",
28
31
  pFullpath As %String = "",
29
32
  pOverwrite As %Boolean = 0,
30
- pProxyClassname As %String = "") As %Status
33
+ pProxyClassname As %String = "",
34
+ pPythonLib,
35
+ pPythonPath,
36
+ pPythonVersion) As %Status
31
37
  {
32
38
  #dim tSC As %Status = $$$OK
33
39
  #dim ex As %Exception.AbstractException
@@ -39,6 +45,9 @@ ClassMethod RegisterComponent(
39
45
  Quit:(""=pModule) $$$ERROR($$$EnsErrGeneral,"Must specify the module of the remote code.")
40
46
 
41
47
  Try {
48
+ LOCK +^PythonSettings:10
49
+ // Set the Python settings
50
+ do ..SetPythonSettings(pPythonLib, pPythonPath, pPythonVersion)
42
51
 
43
52
  $$$ThrowOnError(..GetRemoteClassInfo(pRemoteClassname,pModule,pCLASSPATHS,pFullpath,.tClassDetails,.tRemoteSettings))
44
53
 
@@ -47,13 +56,13 @@ ClassMethod RegisterComponent(
47
56
  Set tConnectionSettings("Classname") = pRemoteClassname
48
57
  Set:(""=pProxyClassname) pProxyClassname = "User."_pRemoteClassname
49
58
 
50
- $$$ThrowOnError(..GenerateProxyClass(pProxyClassname,.tConnectionSettings,tClassDetails,tRemoteSettings,pOverwrite))
59
+ $$$ThrowOnError(..GenerateProxyClass(pProxyClassname,.tConnectionSettings,tClassDetails,tRemoteSettings,pOverwrite, pPythonLib, pPythonPath, pPythonVersion))
51
60
 
52
61
  } Catch ex {
53
62
  set msg = $System.Status.GetOneStatusText(ex.AsStatus(),1)
54
63
  set tSC = $$$ERROR($$$EnsErrGeneral,msg)
55
64
  }
56
-
65
+ LOCK -PythonSettings
57
66
  Quit tSC
58
67
  }
59
68
 
@@ -165,7 +174,10 @@ ClassMethod GenerateProxyClass(
165
174
  ByRef pConnectionSettings,
166
175
  pClassDetails As %String = "",
167
176
  pRemoteSettings As %String = "",
168
- pOverwrite As %Boolean = 0) As %Status [ Internal, Private ]
177
+ pOverwrite As %Boolean = 0,
178
+ pPythonLib,
179
+ pPythonPath,
180
+ pPythonVersion) As %Status [ Internal, Private ]
169
181
  {
170
182
  #dim tSC As %Status = $$$OK
171
183
  #dim ex As %Exception.AbstractException
@@ -226,7 +238,9 @@ ClassMethod GenerateProxyClass(
226
238
  }
227
239
 
228
240
  #; Do not display any of the connection settings
229
- #dim tSETTINGSParamValue As %String = "%classname:Python $type,%module:Python $type,%settings:Python $type,%classpaths:Python $type,%enable:Python Debug $type,%timeout:Python Debug $type,%port:Python Debug $type,%PythonInterpreterPath:Python Debug $type,%traceback:Python Debug $type"
241
+ #dim tSETTINGSParamValue As %String = "%classname:Python $type,%module:Python $type,%settings:Python $type,%classpaths:Python $type"
242
+ set tSETTINGSParamValue = tSETTINGSParamValue_","_"%enable:Python Debug $type,%timeout:Python Debug $type,%port:Python Debug $type,%PythonInterpreterPath:Python Debug $type,%traceback:Python Debug $type"
243
+ set tSETTINGSParamValue = tSETTINGSParamValue_","_"%PythonPath:Python Settings $type,%PythonRuntimeLibrary:Python Settings $type,%PythonRuntimeLibraryVersion:Python Settings $type,%Venv:Python Settings $type"
230
244
 
231
245
  #dim tPropClassname As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
232
246
  Set tPropClassname.Name = "%classname"
@@ -255,6 +269,38 @@ ClassMethod GenerateProxyClass(
255
269
  Set tPropLanguage.InitialExpression = $$$quote(pConnectionSettings("Module"))
256
270
  Set tSC = tCOSClass.Properties.Insert(tPropLanguage)
257
271
  Quit:$$$ISERR(tSC)
272
+
273
+ if pPythonLib'="" {
274
+ #dim tPropPythonLib As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
275
+ Set tPropPythonLib.Name = "%PythonRuntimeLibrary"
276
+ Set tPropPythonLib.Type = "%String"
277
+ Set tPropPythonLib.Internal = 1
278
+ Set tSC = tPropPythonLib.Parameters.SetAt("","MAXLEN")
279
+ Quit:$$$ISERR(tSC)
280
+ Set tPropPythonLib.InitialExpression = $$$quote(pPythonLib)
281
+ Set tSC = tCOSClass.Properties.Insert(tPropPythonLib)
282
+ Quit:$$$ISERR(tSC)
283
+ }
284
+ if pPythonPath'="" {
285
+ #dim tPropPythonPath As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
286
+ Set tPropPythonPath.Name = "%PythonPath"
287
+ Set tPropPythonPath.Type = "%String"
288
+ Set tSC = tPropPythonPath.Parameters.SetAt("","MAXLEN")
289
+ Quit:$$$ISERR(tSC)
290
+ Set tPropPythonPath.Internal = 1
291
+ Set tPropPythonPath.InitialExpression = $$$quote(pPythonPath)
292
+ Set tSC = tCOSClass.Properties.Insert(tPropPythonPath)
293
+ Quit:$$$ISERR(tSC)
294
+ }
295
+ if pPythonVersion'="" {
296
+ #dim tPropPythonVersion As %Dictionary.PropertyDefinition = ##class(%Dictionary.PropertyDefinition).%New()
297
+ Set tPropPythonVersion.Name = "%PythonRuntimeLibraryVersion"
298
+ Set tPropPythonVersion.Type = "%String"
299
+ Set tPropPythonVersion.Internal = 1
300
+ Set tPropPythonVersion.InitialExpression = $$$quote(pPythonVersion)
301
+ Set tSC = tCOSClass.Properties.Insert(tPropPythonVersion)
302
+ Quit:$$$ISERR(tSC)
303
+ }
258
304
 
259
305
  If $Case(tSuperClass,"IOP.BusinessService":1,"IOP.BusinessOperation":1,"IOP.DuplexService":1,"IOP.DuplexOperation":1,:0) {
260
306
  set builtins = ##class(%SYS.Python).Import("builtins")
@@ -419,4 +465,39 @@ ClassMethod dispatchTestComponent(
419
465
  Quit tOutput
420
466
  }
421
467
 
468
+ ClassMethod SetPythonSettings(
469
+ pPythonLib,
470
+ pPythonPath,
471
+ pPythonVersion) As %Status
472
+ {
473
+ set currentNS = $namespace
474
+ set $NAMESPACE = "%SYS"
475
+ set tSC = $$$OK
476
+
477
+ try {
478
+ // Get Config
479
+ $$$ThrowOnError(##Class(Config.config).Get(.Properties))
480
+ // Set the Python interpreter path
481
+ if pPythonPath'="" {
482
+ set Properties("PythonPath") = pPythonPath
483
+ }
484
+
485
+ // Set the Python runtime library
486
+ if pPythonLib'="" {
487
+ set Properties("PythonRuntimeLibrary") = pPythonLib
488
+ }
489
+
490
+ // Set the Python runtime library version
491
+ if pPythonVersion'="" {
492
+ set Properties("PythonRuntimeLibraryVersion") = pPythonVersion
493
+ }
494
+ $$$ThrowOnError(##Class(Config.config).Modify(.Properties))
495
+ } catch ex {
496
+ set tSC = ex.AsStatus()
497
+ }
498
+
499
+ set $NAMESPACE = currentNS
500
+ Quit tSC
501
+ }
502
+
422
503
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iris_pex_embedded_python
3
- Version: 3.4.4b6
3
+ Version: 3.5.0b2
4
4
  Summary: Iris Interoperability based on Embedded Python
5
5
  Author-email: grongier <guillaume.rongier@intersystems.com>
6
6
  License: MIT License