@@ -72,6 +72,18 @@ function M.get_python_command(root)
|
||||
end
|
||||
end
|
||||
|
||||
if lib.files.exists("uv.lock") then
|
||||
local success, exit_code, data = pcall(
|
||||
lib.process.run,
|
||||
{ "uv", "run", "python", "-c", "import sys; print(sys.executable)" },
|
||||
{ stdout = true }
|
||||
)
|
||||
if success and exit_code == 0 then
|
||||
python_command_mem[root] = { Path:new(data).filename }
|
||||
return python_command_mem[root]
|
||||
end
|
||||
end
|
||||
|
||||
-- Fallback to system Python.
|
||||
python_command_mem[root] = {
|
||||
nio.fn.exepath("python3") or nio.fn.exepath("python") or "python",
|
||||
|
Reference in New Issue
Block a user