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

Function getPythonEnvironmentName

src/platform/interpreter/helpers.ts:65–74  ·  view source on GitHub ↗
(pythonEnv: { id: string })

Source from the content-addressed store, hash-verified

63}
64
65export function getPythonEnvironmentName(pythonEnv: { id: string }) {
66 // Sometimes Python extension doesn't detect conda environments correctly (e.g. conda env create without a name).
67 // In such cases the envName is empty, but it has a path.
68 const env = getCachedEnvironment(pythonEnv);
69 let envName = env?.environment?.name;
70 if (!envName && env?.environment?.folderUri && getEnvironmentType(pythonEnv) === EnvironmentType.Conda) {
71 envName = basename(env?.environment?.folderUri);
72 }
73 return envName;
74}
75
76const environmentTypes = [
77 EnvironmentType.Unknown,

Calls 3

getCachedEnvironmentFunction · 0.85
getEnvironmentTypeFunction · 0.85
basenameFunction · 0.85

Tested by

no test coverage detected