This commit is contained in:
Reinier Criel 2025-10-21 15:25:12 -07:00
parent 6a69eec342
commit d0f2edec0a
5 changed files with 60 additions and 22 deletions

View file

@ -0,0 +1,31 @@
import { ui } from "../../environment/userInteraction.js";
import { safeSpawn } from "../../utils/safeSpawn.js";
import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/registryProxy.js";
export function createPipPackageManager() {
return {
runCommand: (args) => runPipCommand("pip3", args),
// For pip, set proxy server
isSupportedCommand: () => false,
getDependencyUpdatesForCommand: () => [],
};
}
async function runPipCommand(command, args) {
try {
console.log("**createPipPackageManager.js** Running pip command");
const result = await safeSpawn(command, args, {
stdio: "inherit",
env: mergeSafeChainProxyEnvironmentVariables(process.env),
});
return { status: result.status };
} catch (error) {
if (error.status) {
return { status: error.status };
} else {
ui.writeError("Error executing command:", error.message);
return { status: 1 };
}
}
}