Skip to content

Commit 50a250d

Browse files
Copilotbytemain
andauthored
Clarify pip availability helper
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/fab67593-0eb0-42b0-b32e-e6f9fe3bf105 Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent 769df24 commit 50a250d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/util.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ local function createWindowsPipShim(scriptsPath)
601601
end
602602
end
603603

604-
local function windowsPipCommandExists(scriptsPath)
604+
local function isPipCommandAvailable(scriptsPath)
605605
return pathExists(scriptsPath .. "\\pip.exe") or pathExists(scriptsPath .. "\\pip.cmd")
606606
end
607607

@@ -616,7 +616,7 @@ local function ensureWindowsUvBuildPip(path)
616616
error("Cannot install pip: python.exe was not found at " .. pythonExe)
617617
end
618618
-- If Scripts does not exist yet, pathExists returns false and setup continues.
619-
if windowsPipCommandExists(scriptsPath) then
619+
if isPipCommandAvailable(scriptsPath) then
620620
return
621621
end
622622

@@ -632,7 +632,7 @@ local function ensureWindowsUvBuildPip(path)
632632
error("ensurepip failed while installing pip. Exit code: " .. tostring(exitCode))
633633
end
634634

635-
if windowsPipCommandExists(scriptsPath) then
635+
if isPipCommandAvailable(scriptsPath) then
636636
return
637637
end
638638

@@ -643,7 +643,7 @@ local function ensureWindowsUvBuildPip(path)
643643
})
644644
local reinstallExitCode = os.execute(reinstallCommand)
645645
if not commandSucceeded(reinstallExitCode) then
646-
error("pip force-reinstall failed. Exit code: " .. tostring(reinstallExitCode))
646+
error("pip force-reinstall step failed before shim creation. Exit code: " .. tostring(reinstallExitCode))
647647
end
648648

649649
local verifyCommand = powerShellPythonCommand(pythonExe, { "-E", "-s", "-m", "pip", "--version" })
@@ -652,7 +652,7 @@ local function ensureWindowsUvBuildPip(path)
652652
error("pip module is not available after installation attempts. Exit code: " .. tostring(verifyExitCode))
653653
end
654654

655-
if not windowsPipCommandExists(scriptsPath) then
655+
if not isPipCommandAvailable(scriptsPath) then
656656
createWindowsPipShim(scriptsPath)
657657
end
658658
end

0 commit comments

Comments
 (0)