sqlalchemy-iris 0.15.3b2__py3-none-any.whl → 0.15.4__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.
- iris/__init__.py +35 -29
- iris/_cli.py +75 -0
- iris/iris_utils.py +336 -0
- sqlalchemy_iris/types.py +3 -3
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/METADATA +2 -2
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/RECORD +10 -8
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/WHEEL +1 -1
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/LICENSE +0 -0
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/entry_points.txt +0 -0
- {sqlalchemy_iris-0.15.3b2.dist-info → sqlalchemy_iris-0.15.4.dist-info}/top_level.txt +0 -0
iris/__init__.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
from sys import path as __syspath
|
2
1
|
import os
|
2
|
+
import sys
|
3
|
+
import importlib
|
4
|
+
|
3
5
|
from .iris_ipm import ipm
|
6
|
+
from .iris_utils import update_dynalib_path
|
4
7
|
|
5
8
|
# check for install dir in environment
|
6
9
|
# environment to check is IRISINSTALLDIR
|
@@ -11,15 +14,45 @@ if installdir is None:
|
|
11
14
|
raise Exception("""Cannot find InterSystems IRIS installation directory
|
12
15
|
Please set IRISINSTALLDIR environment variable to the InterSystems IRIS installation directory""")
|
13
16
|
|
17
|
+
__sysversion_info = sys.version_info
|
18
|
+
__syspath = sys.path
|
19
|
+
__osname = os.name
|
20
|
+
|
14
21
|
# join the install dir with the bin directory
|
15
22
|
__syspath.append(os.path.join(installdir, 'bin'))
|
16
23
|
# also append lib/python
|
17
24
|
__syspath.append(os.path.join(installdir, 'lib', 'python'))
|
18
25
|
|
26
|
+
# update the dynalib path
|
27
|
+
update_dynalib_path(os.path.join(installdir, 'bin'))
|
28
|
+
|
19
29
|
# save working directory
|
20
30
|
__ospath = os.getcwd()
|
21
31
|
|
22
|
-
|
32
|
+
__irispythonint = None
|
33
|
+
|
34
|
+
if __osname=='nt':
|
35
|
+
if __sysversion_info.minor==9:
|
36
|
+
__irispythonint = 'pythonint39'
|
37
|
+
elif __sysversion_info.minor==10:
|
38
|
+
__irispythonint = 'pythonint310'
|
39
|
+
elif __sysversion_info.minor==11:
|
40
|
+
__irispythonint = 'pythonint311'
|
41
|
+
elif __sysversion_info.minor==12:
|
42
|
+
__irispythonint = 'pythonint312'
|
43
|
+
elif __sysversion_info.minor==13:
|
44
|
+
__irispythonint = 'pythonint313'
|
45
|
+
else:
|
46
|
+
__irispythonint = 'pythonint'
|
47
|
+
|
48
|
+
if __irispythonint is not None:
|
49
|
+
# equivalent to from pythonint import *
|
50
|
+
try:
|
51
|
+
__irispythonintmodule = importlib.import_module(__irispythonint)
|
52
|
+
except ImportError:
|
53
|
+
__irispythonint = 'pythonint'
|
54
|
+
__irispythonintmodule = importlib.import_module(__irispythonint)
|
55
|
+
globals().update(vars(__irispythonintmodule))
|
23
56
|
|
24
57
|
# restore working directory
|
25
58
|
os.chdir(__ospath)
|
@@ -31,30 +64,3 @@ os.chdir(__ospath)
|
|
31
64
|
#
|
32
65
|
# End-of-file
|
33
66
|
#
|
34
|
-
|
35
|
-
def __getattr__(name):
|
36
|
-
try:
|
37
|
-
return globals()[name]
|
38
|
-
except KeyError:
|
39
|
-
return __get_iris_object__(name)
|
40
|
-
|
41
|
-
def __get_iris_object__(name:str):
|
42
|
-
try:
|
43
|
-
# replace '_' with '%'
|
44
|
-
name = name.replace('_', '%')
|
45
|
-
return cls(name)
|
46
|
-
except RuntimeError:
|
47
|
-
return __get_iris_package__(name)
|
48
|
-
|
49
|
-
def __get_iris_package__(name:str):
|
50
|
-
return IrisPackage(name)
|
51
|
-
|
52
|
-
class IrisPackage:
|
53
|
-
def __init__(self, name:str):
|
54
|
-
self.name = name
|
55
|
-
|
56
|
-
def __getattr__(self, name):
|
57
|
-
try:
|
58
|
-
return globals()[f"{self.name}.{name}"]
|
59
|
-
except KeyError:
|
60
|
-
return __get_iris_object__(f"{self.name}.{name}")
|
iris/_cli.py
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
import argparse
|
4
|
+
import logging
|
5
|
+
|
6
|
+
from . import iris_utils
|
7
|
+
import iris
|
8
|
+
|
9
|
+
logging.basicConfig(level=logging.INFO)
|
10
|
+
|
11
|
+
VENV_BACKUP_GREF = "^Venv.BackUp"
|
12
|
+
|
13
|
+
def bind():
|
14
|
+
parser = argparse.ArgumentParser()
|
15
|
+
parser.add_argument("--namespace", default="")
|
16
|
+
args = parser.parse_args()
|
17
|
+
|
18
|
+
iris_gref = iris.gref(VENV_BACKUP_GREF)
|
19
|
+
|
20
|
+
path = ""
|
21
|
+
|
22
|
+
libpython = iris_utils.find_libpython()
|
23
|
+
if not libpython:
|
24
|
+
logging.error("libpython not found")
|
25
|
+
raise RuntimeError("libpython not found")
|
26
|
+
|
27
|
+
iris.system.Process.SetNamespace("%SYS")
|
28
|
+
|
29
|
+
config = iris.cls("Config.config").Open()
|
30
|
+
|
31
|
+
# Set the new libpython path
|
32
|
+
iris_gref["PythonRuntimeLibrary"] = config.PythonRuntimeLibrary
|
33
|
+
|
34
|
+
config.PythonRuntimeLibrary = libpython
|
35
|
+
|
36
|
+
if "VIRTUAL_ENV" in os.environ:
|
37
|
+
# we are not in a virtual environment
|
38
|
+
path = os.path.join(os.environ["VIRTUAL_ENV"], "lib", "python" + sys.version[:4], "site-packages")
|
39
|
+
|
40
|
+
iris_gref["PythonPath"] = config.PythonPath
|
41
|
+
|
42
|
+
config.PythonPath = path
|
43
|
+
|
44
|
+
config._Save()
|
45
|
+
|
46
|
+
log_config_changes(libpython, path)
|
47
|
+
|
48
|
+
def unbind():
|
49
|
+
iris.system.Process.SetNamespace("%SYS")
|
50
|
+
config = iris.cls("Config.config").Open()
|
51
|
+
|
52
|
+
iris_gref = iris.gref(VENV_BACKUP_GREF)
|
53
|
+
|
54
|
+
if iris_gref["PythonRuntimeLibrary"]:
|
55
|
+
config.PythonRuntimeLibrary = iris_gref["PythonRuntimeLibrary"]
|
56
|
+
else:
|
57
|
+
config.PythonRuntimeLibrary = ""
|
58
|
+
|
59
|
+
if iris_gref["PythonPath"]:
|
60
|
+
config.PythonPath = iris_gref["PythonPath"]
|
61
|
+
else:
|
62
|
+
config.PythonPath = ""
|
63
|
+
|
64
|
+
config._Save()
|
65
|
+
|
66
|
+
del iris_gref["PythonRuntimeLibrary"]
|
67
|
+
del iris_gref["PythonPath"]
|
68
|
+
del iris_gref[None]
|
69
|
+
|
70
|
+
log_config_changes(config.PythonRuntimeLibrary, config.PythonPath)
|
71
|
+
|
72
|
+
def log_config_changes(libpython, path):
|
73
|
+
logging.info("PythonRuntimeLibrary path set to %s", libpython)
|
74
|
+
logging.info("PythonPath set to %s", path)
|
75
|
+
logging.info("To iris instance %s", iris.cls("%SYS.System").GetUniqueInstanceName())
|
iris/iris_utils.py
ADDED
@@ -0,0 +1,336 @@
|
|
1
|
+
"""
|
2
|
+
Locate libpython associated with this Python executable.
|
3
|
+
"""
|
4
|
+
|
5
|
+
# License
|
6
|
+
#
|
7
|
+
# Copyright 2018, Takafumi Arakaki
|
8
|
+
#
|
9
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
10
|
+
# a copy of this software and associated documentation files (the
|
11
|
+
# "Software"), to deal in the Software without restriction, including
|
12
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
13
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
14
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
15
|
+
# the following conditions:
|
16
|
+
#
|
17
|
+
# The above copyright notice and this permission notice shall be
|
18
|
+
# included in all copies or substantial portions of the Software.
|
19
|
+
#
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
24
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
25
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
26
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
|
28
|
+
from __future__ import print_function, absolute_import
|
29
|
+
|
30
|
+
from logging import getLogger
|
31
|
+
import ctypes.util
|
32
|
+
import functools
|
33
|
+
import os
|
34
|
+
import sys
|
35
|
+
import sysconfig
|
36
|
+
import re
|
37
|
+
|
38
|
+
logger = getLogger("find_libpython")
|
39
|
+
|
40
|
+
is_windows = os.name == "nt"
|
41
|
+
is_apple = sys.platform == "darwin"
|
42
|
+
|
43
|
+
SHLIB_SUFFIX = sysconfig.get_config_var("SHLIB_SUFFIX")
|
44
|
+
if SHLIB_SUFFIX is None:
|
45
|
+
if is_windows:
|
46
|
+
SHLIB_SUFFIX = ".dll"
|
47
|
+
else:
|
48
|
+
SHLIB_SUFFIX = ".so"
|
49
|
+
if is_apple:
|
50
|
+
# sysconfig.get_config_var("SHLIB_SUFFIX") can be ".so" in macOS.
|
51
|
+
# Let's not use the value from sysconfig.
|
52
|
+
SHLIB_SUFFIX = ".dylib"
|
53
|
+
|
54
|
+
|
55
|
+
def linked_libpython():
|
56
|
+
"""
|
57
|
+
Find the linked libpython using dladdr (in *nix).
|
58
|
+
|
59
|
+
Calling this in Windows always return `None` at the moment.
|
60
|
+
|
61
|
+
Returns
|
62
|
+
-------
|
63
|
+
path : str or None
|
64
|
+
A path to linked libpython. Return `None` if statically linked.
|
65
|
+
"""
|
66
|
+
if is_windows:
|
67
|
+
return None
|
68
|
+
return _linked_libpython_unix()
|
69
|
+
|
70
|
+
|
71
|
+
class Dl_info(ctypes.Structure):
|
72
|
+
_fields_ = [
|
73
|
+
("dli_fname", ctypes.c_char_p),
|
74
|
+
("dli_fbase", ctypes.c_void_p),
|
75
|
+
("dli_sname", ctypes.c_char_p),
|
76
|
+
("dli_saddr", ctypes.c_void_p),
|
77
|
+
]
|
78
|
+
|
79
|
+
|
80
|
+
def _linked_libpython_unix():
|
81
|
+
libdl = ctypes.CDLL(ctypes.util.find_library("dl"))
|
82
|
+
libdl.dladdr.argtypes = [ctypes.c_void_p, ctypes.POINTER(Dl_info)]
|
83
|
+
libdl.dladdr.restype = ctypes.c_int
|
84
|
+
|
85
|
+
dlinfo = Dl_info()
|
86
|
+
retcode = libdl.dladdr(
|
87
|
+
ctypes.cast(ctypes.pythonapi.Py_GetVersion, ctypes.c_void_p),
|
88
|
+
ctypes.pointer(dlinfo))
|
89
|
+
if retcode == 0: # means error
|
90
|
+
return None
|
91
|
+
path = os.path.realpath(dlinfo.dli_fname.decode())
|
92
|
+
if path == os.path.realpath(sys.executable):
|
93
|
+
return None
|
94
|
+
return path
|
95
|
+
|
96
|
+
|
97
|
+
def library_name(name, suffix=SHLIB_SUFFIX, is_windows=is_windows):
|
98
|
+
"""
|
99
|
+
Convert a file basename `name` to a library name (no "lib" and ".so" etc.)
|
100
|
+
|
101
|
+
>>> library_name("libpython3.7m.so") # doctest: +SKIP
|
102
|
+
'python3.7m'
|
103
|
+
>>> library_name("libpython3.7m.so", suffix=".so", is_windows=False)
|
104
|
+
'python3.7m'
|
105
|
+
>>> library_name("libpython3.7m.dylib", suffix=".dylib", is_windows=False)
|
106
|
+
'python3.7m'
|
107
|
+
>>> library_name("python37.dll", suffix=".dll", is_windows=True)
|
108
|
+
'python37'
|
109
|
+
"""
|
110
|
+
if not is_windows and name.startswith("lib"):
|
111
|
+
name = name[len("lib"):]
|
112
|
+
if suffix and name.endswith(suffix):
|
113
|
+
name = name[:-len(suffix)]
|
114
|
+
return name
|
115
|
+
|
116
|
+
|
117
|
+
def append_truthy(list, item):
|
118
|
+
if item:
|
119
|
+
list.append(item)
|
120
|
+
|
121
|
+
|
122
|
+
def uniquifying(items):
|
123
|
+
"""
|
124
|
+
Yield items while excluding the duplicates and preserving the order.
|
125
|
+
|
126
|
+
>>> list(uniquifying([1, 2, 1, 2, 3]))
|
127
|
+
[1, 2, 3]
|
128
|
+
"""
|
129
|
+
seen = set()
|
130
|
+
for x in items:
|
131
|
+
if x not in seen:
|
132
|
+
yield x
|
133
|
+
seen.add(x)
|
134
|
+
|
135
|
+
|
136
|
+
def uniquified(func):
|
137
|
+
""" Wrap iterator returned from `func` by `uniquifying`. """
|
138
|
+
@functools.wraps(func)
|
139
|
+
def wrapper(*args, **kwds):
|
140
|
+
return uniquifying(func(*args, **kwds))
|
141
|
+
return wrapper
|
142
|
+
|
143
|
+
|
144
|
+
@uniquified
|
145
|
+
def candidate_names(suffix=SHLIB_SUFFIX):
|
146
|
+
"""
|
147
|
+
Iterate over candidate file names of libpython.
|
148
|
+
|
149
|
+
Yields
|
150
|
+
------
|
151
|
+
name : str
|
152
|
+
Candidate name libpython.
|
153
|
+
"""
|
154
|
+
LDLIBRARY = sysconfig.get_config_var("LDLIBRARY")
|
155
|
+
if LDLIBRARY:
|
156
|
+
yield LDLIBRARY
|
157
|
+
|
158
|
+
LIBRARY = sysconfig.get_config_var("LIBRARY")
|
159
|
+
if LIBRARY:
|
160
|
+
yield os.path.splitext(LIBRARY)[0] + suffix
|
161
|
+
|
162
|
+
dlprefix = "" if is_windows else "lib"
|
163
|
+
sysdata = dict(
|
164
|
+
v=sys.version_info,
|
165
|
+
# VERSION is X.Y in Linux/macOS and XY in Windows:
|
166
|
+
VERSION=(sysconfig.get_config_var("VERSION") or
|
167
|
+
"{v.major}.{v.minor}".format(v=sys.version_info)),
|
168
|
+
ABIFLAGS=(sysconfig.get_config_var("ABIFLAGS") or
|
169
|
+
sysconfig.get_config_var("abiflags") or ""),
|
170
|
+
)
|
171
|
+
|
172
|
+
for stem in [
|
173
|
+
"python{VERSION}{ABIFLAGS}".format(**sysdata),
|
174
|
+
"python{VERSION}".format(**sysdata),
|
175
|
+
"python{v.major}".format(**sysdata),
|
176
|
+
"python",
|
177
|
+
]:
|
178
|
+
yield dlprefix + stem + suffix
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
@uniquified
|
183
|
+
def candidate_paths(suffix=SHLIB_SUFFIX):
|
184
|
+
"""
|
185
|
+
Iterate over candidate paths of libpython.
|
186
|
+
|
187
|
+
Yields
|
188
|
+
------
|
189
|
+
path : str or None
|
190
|
+
Candidate path to libpython. The path may not be a fullpath
|
191
|
+
and may not exist.
|
192
|
+
"""
|
193
|
+
|
194
|
+
yield linked_libpython()
|
195
|
+
|
196
|
+
# List candidates for directories in which libpython may exist
|
197
|
+
lib_dirs = []
|
198
|
+
append_truthy(lib_dirs, sysconfig.get_config_var('LIBPL'))
|
199
|
+
append_truthy(lib_dirs, sysconfig.get_config_var('srcdir'))
|
200
|
+
append_truthy(lib_dirs, sysconfig.get_config_var("LIBDIR"))
|
201
|
+
|
202
|
+
# LIBPL seems to be the right config_var to use. It is the one
|
203
|
+
# used in python-config when shared library is not enabled:
|
204
|
+
# https://github.com/python/cpython/blob/v3.7.0/Misc/python-config.in#L55-L57
|
205
|
+
#
|
206
|
+
# But we try other places just in case.
|
207
|
+
|
208
|
+
if is_windows:
|
209
|
+
lib_dirs.append(os.path.join(os.path.dirname(sys.executable)))
|
210
|
+
else:
|
211
|
+
lib_dirs.append(os.path.join(
|
212
|
+
os.path.dirname(os.path.dirname(sys.executable)),
|
213
|
+
"lib"))
|
214
|
+
|
215
|
+
# For macOS:
|
216
|
+
append_truthy(lib_dirs, sysconfig.get_config_var("PYTHONFRAMEWORKPREFIX"))
|
217
|
+
|
218
|
+
lib_dirs.append(sys.exec_prefix)
|
219
|
+
lib_dirs.append(os.path.join(sys.exec_prefix, "lib"))
|
220
|
+
|
221
|
+
lib_basenames = list(candidate_names(suffix=suffix))
|
222
|
+
|
223
|
+
for directory in lib_dirs:
|
224
|
+
for basename in lib_basenames:
|
225
|
+
yield os.path.join(directory, basename)
|
226
|
+
|
227
|
+
# In macOS and Windows, ctypes.util.find_library returns a full path:
|
228
|
+
for basename in lib_basenames:
|
229
|
+
yield ctypes.util.find_library(library_name(basename))
|
230
|
+
|
231
|
+
# Possibly useful links:
|
232
|
+
# * https://packages.ubuntu.com/bionic/amd64/libpython3.6/filelist
|
233
|
+
# * https://github.com/Valloric/ycmd/issues/518
|
234
|
+
# * https://github.com/Valloric/ycmd/pull/519
|
235
|
+
|
236
|
+
|
237
|
+
def normalize_path(path, suffix=SHLIB_SUFFIX, is_apple=is_apple):
|
238
|
+
"""
|
239
|
+
Normalize shared library `path` to a real path.
|
240
|
+
|
241
|
+
If `path` is not a full path, `None` is returned. If `path` does
|
242
|
+
not exists, append `SHLIB_SUFFIX` and check if it exists.
|
243
|
+
Finally, the path is canonicalized by following the symlinks.
|
244
|
+
|
245
|
+
Parameters
|
246
|
+
----------
|
247
|
+
path : str ot None
|
248
|
+
A candidate path to a shared library.
|
249
|
+
"""
|
250
|
+
if not path:
|
251
|
+
return None
|
252
|
+
if not os.path.isabs(path):
|
253
|
+
return None
|
254
|
+
if os.path.exists(path):
|
255
|
+
return os.path.realpath(path)
|
256
|
+
if os.path.exists(path + suffix):
|
257
|
+
return os.path.realpath(path + suffix)
|
258
|
+
if is_apple:
|
259
|
+
return normalize_path(_remove_suffix_apple(path),
|
260
|
+
suffix=".so", is_apple=False)
|
261
|
+
return None
|
262
|
+
|
263
|
+
|
264
|
+
def _remove_suffix_apple(path):
|
265
|
+
"""
|
266
|
+
Strip off .so or .dylib.
|
267
|
+
|
268
|
+
>>> _remove_suffix_apple("libpython.so")
|
269
|
+
'libpython'
|
270
|
+
>>> _remove_suffix_apple("libpython.dylib")
|
271
|
+
'libpython'
|
272
|
+
>>> _remove_suffix_apple("libpython3.7")
|
273
|
+
'libpython3.7'
|
274
|
+
"""
|
275
|
+
if path.endswith(".dylib"):
|
276
|
+
return path[:-len(".dylib")]
|
277
|
+
if path.endswith(".so"):
|
278
|
+
return path[:-len(".so")]
|
279
|
+
return path
|
280
|
+
|
281
|
+
|
282
|
+
@uniquified
|
283
|
+
def finding_libpython():
|
284
|
+
"""
|
285
|
+
Iterate over existing libpython paths.
|
286
|
+
|
287
|
+
The first item is likely to be the best one.
|
288
|
+
|
289
|
+
Yields
|
290
|
+
------
|
291
|
+
path : str
|
292
|
+
Existing path to a libpython.
|
293
|
+
"""
|
294
|
+
logger.debug("is_windows = %s", is_windows)
|
295
|
+
logger.debug("is_apple = %s", is_apple)
|
296
|
+
for path in candidate_paths():
|
297
|
+
logger.debug("Candidate: %s", path)
|
298
|
+
normalized = normalize_path(path)
|
299
|
+
if normalized:
|
300
|
+
logger.debug("Found: %s", normalized)
|
301
|
+
yield normalized
|
302
|
+
else:
|
303
|
+
logger.debug("Not found.")
|
304
|
+
|
305
|
+
|
306
|
+
def find_libpython():
|
307
|
+
"""
|
308
|
+
Return a path (`str`) to libpython or `None` if not found.
|
309
|
+
|
310
|
+
Parameters
|
311
|
+
----------
|
312
|
+
path : str or None
|
313
|
+
Existing path to the (supposedly) correct libpython.
|
314
|
+
"""
|
315
|
+
for path in finding_libpython():
|
316
|
+
return os.path.realpath(path)
|
317
|
+
|
318
|
+
def update_dynalib_path(dynalib_path):
|
319
|
+
# Determine the environment variable based on the operating system
|
320
|
+
env_var = 'PATH'
|
321
|
+
if not sys.platform.startswith('win'):
|
322
|
+
if sys.platform == 'darwin':
|
323
|
+
env_var = 'DYLD_LIBRARY_PATH'
|
324
|
+
else:
|
325
|
+
env_var = 'LD_LIBRARY_PATH'
|
326
|
+
|
327
|
+
# Get the current value of the environment variable
|
328
|
+
current_paths = os.environ.get(env_var, '')
|
329
|
+
|
330
|
+
# Update the environment variable by appending the dynalib path
|
331
|
+
# Note: You can prepend instead by reversing the order in the join
|
332
|
+
new_paths = f"{current_paths}:{dynalib_path}" if current_paths else dynalib_path
|
333
|
+
|
334
|
+
# Update the environment variable
|
335
|
+
os.environ[env_var] = new_paths
|
336
|
+
|
sqlalchemy_iris/types.py
CHANGED
@@ -58,7 +58,7 @@ class IRISDate(sqltypes.Date):
|
|
58
58
|
|
59
59
|
|
60
60
|
class IRISTimeStamp(sqltypes.DateTime):
|
61
|
-
__visit_name__ = "
|
61
|
+
__visit_name__ = "TIMESTAMP"
|
62
62
|
|
63
63
|
def bind_processor(self, dialect):
|
64
64
|
def process(value: datetime.datetime):
|
@@ -86,7 +86,7 @@ class IRISTimeStamp(sqltypes.DateTime):
|
|
86
86
|
|
87
87
|
|
88
88
|
class IRISDateTime(sqltypes.DateTime):
|
89
|
-
__visit_name__ = "
|
89
|
+
__visit_name__ = "DATETIME"
|
90
90
|
|
91
91
|
def bind_processor(self, dialect):
|
92
92
|
def process(value):
|
@@ -110,7 +110,7 @@ class IRISDateTime(sqltypes.DateTime):
|
|
110
110
|
|
111
111
|
|
112
112
|
class IRISTime(sqltypes.DateTime):
|
113
|
-
__visit_name__ = "
|
113
|
+
__visit_name__ = "TIME"
|
114
114
|
|
115
115
|
def bind_processor(self, dialect):
|
116
116
|
def process(value):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: sqlalchemy-iris
|
3
|
-
Version: 0.15.
|
3
|
+
Version: 0.15.4
|
4
4
|
Summary: InterSystems IRIS for SQLAlchemy
|
5
5
|
Home-page: https://github.com/caretdev/sqlalchemy-iris
|
6
6
|
Maintainer: CaretDev
|
@@ -22,7 +22,7 @@ Classifier: Operating System :: OS Independent
|
|
22
22
|
Requires-Python: >=3.8
|
23
23
|
Description-Content-Type: text/markdown
|
24
24
|
License-File: LICENSE
|
25
|
-
Requires-Dist: SQLAlchemy
|
25
|
+
Requires-Dist: SQLAlchemy>=1.3
|
26
26
|
|
27
27
|
sqlalchemy-iris
|
28
28
|
===
|
@@ -61,10 +61,12 @@ intersystems_iris/pex/_InboundAdapter.py,sha256=gZlWl7afumamkj8pNbpLyKFSzhaTAiAX
|
|
61
61
|
intersystems_iris/pex/_Message.py,sha256=Ugaa_lsEYke__pI5kdC7phAuyPQ7rxXUcROJL4cUxVQ,320
|
62
62
|
intersystems_iris/pex/_OutboundAdapter.py,sha256=ao2Ubbta2DcrQGdzDUD_j1Zsk8bvUfcZNKTZkzPTNBU,1628
|
63
63
|
intersystems_iris/pex/__init__.py,sha256=l_I1dpnluWawbFrGMDC0GLHpuHwjbpd-nho8otFX6TE,1379
|
64
|
-
iris/__init__.py,sha256=
|
64
|
+
iris/__init__.py,sha256=i0PK20mjoWOnFPQM0pHF8wMjjmh-5i1xLEduy4r-q9o,2036
|
65
65
|
iris/__init__.pyi,sha256=HPv6Lot6yZt8XXj3Rb0CrVO9ChDbKVpE3ID1SIqAlwU,9766
|
66
|
+
iris/_cli.py,sha256=HsmaY22h2a9EofCLcm_CU-ZikQNqFPDlH5xDvLon-Ko,1983
|
66
67
|
iris/iris_ipm.py,sha256=Q0jcNItjywlqOPZr0hgdTFSeLPNEmB-tcICOI_cXnaY,790
|
67
68
|
iris/iris_ipm.pyi,sha256=j7CNUZcjeDu5sgeWUZJO_Qi4vQmHh6aD-jPWv8OdoUs,374
|
69
|
+
iris/iris_utils.py,sha256=kg80O3yRpHIutM-mCyr4xCeTvKWPE-Kai-b6Dxw4vQ4,9882
|
68
70
|
irisnative/_IRISNative.py,sha256=HQ4nBhc8t8_5OtxdMG-kx1aa-T1znf2I8obZOPLOPzg,665
|
69
71
|
irisnative/__init__.py,sha256=6YmvBLQSURsCPKaNg7LK-xpo4ipDjrlhKuwdfdNb3Kg,341
|
70
72
|
sqlalchemy_iris/__init__.py,sha256=2bckDQ0AJJ9DfuAc20VVQNiK-YBhpYJMdo_C0qJwPHQ,1183
|
@@ -76,10 +78,10 @@ sqlalchemy_iris/iris.py,sha256=Of0Ruc9W2c5ll5sjAy1xRo4tf1m0l_ab0vAdacTv3Yw,276
|
|
76
78
|
sqlalchemy_iris/irisasync.py,sha256=7Kmso-RGjxQi9Y4x-zQaUk1ylDQ7TDvpvlZh_syJtGw,312
|
77
79
|
sqlalchemy_iris/provision.py,sha256=drorbIgNO770Ws0XiCRXY_sDbQGIy2_zzNK3KYrDetY,198
|
78
80
|
sqlalchemy_iris/requirements.py,sha256=2MPADPOk3qvXCyr7xXvkl_MfkE8v75Z3yGJO0RbzRog,7560
|
79
|
-
sqlalchemy_iris/types.py,sha256=
|
80
|
-
sqlalchemy_iris-0.15.
|
81
|
-
sqlalchemy_iris-0.15.
|
82
|
-
sqlalchemy_iris-0.15.
|
83
|
-
sqlalchemy_iris-0.15.
|
84
|
-
sqlalchemy_iris-0.15.
|
85
|
-
sqlalchemy_iris-0.15.
|
81
|
+
sqlalchemy_iris/types.py,sha256=mtm5wQQuA4pE6WB4EUHzAcpdBCLfZKHrY9qOcdllc7E,11077
|
82
|
+
sqlalchemy_iris-0.15.4.dist-info/LICENSE,sha256=RQmigqltsLq8lfOBc_KwtL0gkODyUCNpU-0ZiZwGlho,1075
|
83
|
+
sqlalchemy_iris-0.15.4.dist-info/METADATA,sha256=QaOh8RoJtz0j3ztbxAS5NPTKd9ddyAHGmXrO27PtQYE,2354
|
84
|
+
sqlalchemy_iris-0.15.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
85
|
+
sqlalchemy_iris-0.15.4.dist-info/entry_points.txt,sha256=zjOwyJPXHsNAeQP0n6l2_pav2U__rTAiS_Bk_IEmSlU,184
|
86
|
+
sqlalchemy_iris-0.15.4.dist-info/top_level.txt,sha256=mjpHqFjekbB1TWr3xI3o4AqN3Spby-_uqyuSSeBDmuw,50
|
87
|
+
sqlalchemy_iris-0.15.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|