MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / getInterpreterKernelSpecName

Function getInterpreterKernelSpecName

src/kernels/helpers.ts:524–533  ·  view source on GitHub ↗
(interpreter?: PythonEnvironment)

Source from the content-addressed store, hash-verified

522 * WARNING: Changes to this will impact `getKernelId()`
523 */
524export 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.

Calls 4

getTelemetrySafeVersionFunction · 0.90
getCachedVersionFunction · 0.90
getInterpreterHashFunction · 0.90
replaceMethod · 0.45

Tested by

no test coverage detected