@@ -21,6 +21,8 @@ local REQUEST_HEADERS = {
2121 [" User-Agent" ] = " vfox"
2222}
2323
24+ local WINDOWS_PIP_SHIM_CONTENT = " @echo off\r\n\" %~dp0..\\ python.exe\" -m pip %*\r\n "
25+
2426local UV_BUILD_ENV = " VFOX_PYTHON_USE_UV_BUILD"
2527local UV_BUILD_MIRROR_ENV = " VFOX_PYTHON_UV_BUILD_MIRROR"
2628
@@ -574,7 +576,7 @@ local function ensureWindowsDirectory(path)
574576 local command = powerShellCommand (" New-Item -ItemType Directory -Force -Path " .. powerShellQuote (path ) .. " | Out-Null" )
575577 local exitCode = os.execute (command )
576578 if not commandSucceeded (exitCode ) then
577- error (" Failed to create directory: " .. path .. " . Exit code: " .. tostring (exitCode ))
579+ error (" Failed to create directory: " .. path .. " . Command: " .. command .. " . Exit code: " .. tostring (exitCode ))
578580 end
579581end
580582
@@ -592,13 +594,14 @@ local function createWindowsPipShim(installPath, version)
592594 local scriptsPath = installPath .. " \\ Scripts"
593595 ensureWindowsDirectory (scriptsPath )
594596
595- local content = " @echo off\r\n\" %~dp0..\\ python.exe\" -m pip %*\r\n "
596597 local shims = { " pip.cmd" , " pip3.cmd" }
597598 if major ~= nil and minor ~= nil then
598599 table.insert (shims , " pip" .. major .. " ." .. minor .. " .cmd" )
600+ else
601+ print (" Warning: unable to create versioned pip shim for unexpected Python version: " .. version )
599602 end
600603 for _ , shim in ipairs (shims ) do
601- writeWindowsFile (scriptsPath .. " \\ " .. shim , content )
604+ writeWindowsFile (scriptsPath .. " \\ " .. shim , WINDOWS_PIP_SHIM_CONTENT )
602605 end
603606end
604607
0 commit comments