( basePath: string = UV_PYTHON_PATH_PREFIX )
| 335 | * avoids spawning a `uv python list` subprocess. |
| 336 | */ |
| 337 | export function getInstalledPythonsFromFilesystem( |
| 338 | basePath: string = UV_PYTHON_PATH_PREFIX |
| 339 | ): Set<string> { |
| 340 | const result = new Set<string>(); |
| 341 | for (const opt of allOptions) { |
| 342 | const version = pythonVersionString(opt); |
| 343 | if (!version) continue; |
| 344 | const binPath = join(basePath, 'bin', `python${version}`); |
| 345 | if (existsSync(binPath)) { |
| 346 | result.add(version); |
| 347 | } |
| 348 | } |
| 349 | return result; |
| 350 | } |
| 351 | |
| 352 | function getInstalledPythons(): Set<string> { |
| 353 | if (installedPythonsCache !== null) { |
no test coverage detected