MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / getEmbeddedPython

Function getEmbeddedPython

src/core/include/core/executable_path.hpp:324–351  ·  view source on GitHub ↗

Embedded Python executable (base interpreter for uv sync/venv and plugin isolation)

Source from the content-addressed store, hash-verified

322
323 // Embedded Python executable (base interpreter for uv sync/venv and plugin isolation)
324 inline std::filesystem::path getEmbeddedPython() {
325 const auto exe_dir = getExecutableDir();
326
327#ifdef _WIN32
328 if (const auto p = exe_dir / "python.exe"; std::filesystem::exists(p))
329 return p;
330
331 if (const auto prefix = findVcpkgPrefix(exe_dir); !prefix.empty()) {
332 if (const auto p = prefix / "tools" / "python3" / "python.exe"; std::filesystem::exists(p))
333 return p;
334 }
335#else
336 if (const auto p = exe_dir / "python3"; std::filesystem::exists(p))
337 return p;
338
339 if (const auto prefix = findVcpkgPrefix(exe_dir); !prefix.empty()) {
340 if (const auto p = prefix / "tools" / "python3" / "python3.12"; std::filesystem::exists(p))
341 return p;
342 }
343#endif
344
345#ifdef LFS_PYTHON_EXECUTABLE
346 if (const auto p = std::filesystem::path(LFS_PYTHON_EXECUTABLE); std::filesystem::exists(p))
347 return p;
348#endif
349
350 return {};
351 }
352
353 // nvImageCodec extensions directory
354 inline std::filesystem::path getExtensionsDir() {

Callers 3

run_plugin_commandFunction · 0.85
ensure_venvMethod · 0.85
register_packagesFunction · 0.85

Calls 3

getExecutableDirFunction · 0.85
findVcpkgPrefixFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected