MCPcopy
hub / github.com/ValueCell-ai/ClawX / isPythonReady

Function isPythonReady

electron/utils/uv-setup.ts:90–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 * Check if a managed Python 3.12 is ready and accessible
89 */
90export async function isPythonReady(): Promise<boolean> {
91 const { bin: uvBin } = resolveUvBin();
92 const useShell = needsWinShell(uvBin);
93
94 return new Promise<boolean>((resolve) => {
95 try {
96 const child = spawn(useShell ? quoteForCmd(uvBin) : uvBin, ['python', 'find', '3.12'], {
97 shell: useShell,
98 windowsHide: true,
99 });
100 child.on('close', (code) => resolve(code === 0));
101 child.on('error', () => resolve(false));
102 } catch {
103 resolve(false);
104 }
105 });
106}
107
108/**
109 * Run `uv python install 3.12` once with the given environment.

Callers 1

Calls 4

resolveUvBinFunction · 0.85
needsWinShellFunction · 0.85
quoteForCmdFunction · 0.85
onMethod · 0.65

Tested by

no test coverage detected