(interpreter?: PythonEnvironment)
| 522 | * WARNING: Changes to this will impact `getKernelId()` |
| 523 | */ |
| 524 | export async function getInterpreterKernelSpecName(interpreter?: PythonEnvironment): Promise<string> { |
| 525 | // Generate a name from a hash of the interpreter |
| 526 | // Note it must be prefixed with 'python' and the version number. |
| 527 | const version = getTelemetrySafeVersion(getCachedVersion(interpreter)) || '3'; |
| 528 | const versionWithSafeStrings = version.replace(/\./g, ''); |
| 529 | const prefix = interpreter ? `python${versionWithSafeStrings}` : ''; |
| 530 | return interpreter |
| 531 | ? `${prefix}${autoGeneratedKernelNameIdentifier}${await getInterpreterHash(interpreter)}` |
| 532 | : 'python3'; |
| 533 | } |
| 534 | |
| 535 | /** |
| 536 | * Gets information about the registered kernelspec. |
no test coverage detected