MCPcopy
hub / github.com/volcengine/OpenViking / _get_windows_python_sabi_library

Function _get_windows_python_sabi_library

setup.py:71–103  ·  view source on GitHub ↗

Return the stable-ABI Python library path for Windows abi3 extensions.

()

Source from the content-addressed store, hash-verified

69
70
71def _get_windows_python_sabi_library() -> Path:
72 """Return the stable-ABI Python library path for Windows abi3 extensions."""
73 candidate_roots = []
74 for raw_root in (
75 sys.base_prefix,
76 sys.base_exec_prefix,
77 sysconfig.get_config_var("installed_base"),
78 sysconfig.get_config_var("base"),
79 ):
80 if not raw_root:
81 continue
82 candidate_root = Path(raw_root).resolve()
83 if candidate_root not in candidate_roots:
84 candidate_roots.append(candidate_root)
85
86 candidate_paths = []
87 for root in candidate_roots:
88 candidate_paths.extend(
89 [
90 root / "libs" / "python3.lib",
91 root / "python3.dll",
92 ]
93 )
94
95 for candidate_path in candidate_paths:
96 if candidate_path.exists():
97 return candidate_path
98
99 searched = ", ".join(str(path) for path in candidate_paths) or "<none>"
100 raise RuntimeError(
101 "Could not locate the Windows stable-ABI Python library for abi3 engine modules. "
102 f"Searched: {searched}"
103 )
104
105
106class OpenVikingBuildExt(build_ext):

Callers 1

_build_extension_implMethod · 0.85

Calls 6

strFunction · 0.50
resolveMethod · 0.45
appendMethod · 0.45
extendMethod · 0.45
existsMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected