pyopentrustregion 3.0.1__py3-none-win_amd64.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.
@@ -0,0 +1,47 @@
1
+ # Copyright (C) 2025- Jonas Greiner
2
+ #
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+
7
+
8
+ # start delvewheel patch
9
+ def _delvewheel_patch_1_13_2():
10
+ import ctypes
11
+ import os
12
+ import platform
13
+ import sys
14
+ libs_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'pyopentrustregion.libs'))
15
+ is_conda_cpython = platform.python_implementation() == 'CPython' and (hasattr(ctypes.pythonapi, 'Anaconda_GetVersion') or 'packaged by conda-forge' in sys.version)
16
+ if sys.version_info[:2] >= (3, 8) and not is_conda_cpython or sys.version_info[:2] >= (3, 10):
17
+ if os.path.isdir(libs_dir):
18
+ os.add_dll_directory(libs_dir)
19
+ else:
20
+ load_order_filepath = os.path.join(libs_dir, '.load-order-pyopentrustregion-3.0.1')
21
+ if os.path.isfile(load_order_filepath):
22
+ import ctypes.wintypes
23
+ with open(os.path.join(libs_dir, '.load-order-pyopentrustregion-3.0.1'), encoding='utf-8') as file:
24
+ load_order = file.read().split()
25
+ kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
26
+ kernel32.LoadLibraryExW.restype = ctypes.wintypes.HMODULE
27
+ kernel32.LoadLibraryExW.argtypes = ctypes.wintypes.LPCWSTR, ctypes.wintypes.HANDLE, ctypes.wintypes.DWORD
28
+ for lib in load_order:
29
+ lib_path = os.path.join(os.path.join(libs_dir, lib))
30
+ if os.path.isfile(lib_path) and not kernel32.LoadLibraryExW(lib_path, None, 8):
31
+ raise OSError('Error loading {}; {}'.format(lib, ctypes.FormatError(ctypes.get_last_error())))
32
+
33
+
34
+ _delvewheel_patch_1_13_2()
35
+ del _delvewheel_patch_1_13_2
36
+ # end delvewheel patch
37
+
38
+ from .python_interface import (
39
+ SolverSettings,
40
+ StabilitySettings,
41
+ SolverState,
42
+ StabilityState,
43
+ solver,
44
+ stability_check,
45
+ c_int,
46
+ c_real,
47
+ )