()
| 88 | * Check if a managed Python 3.12 is ready and accessible |
| 89 | */ |
| 90 | export 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. |
no test coverage detected