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

Function getCachedEnvironment

src/platform/interpreter/helpers.ts:150–164  ·  view source on GitHub ↗
(interpreter?: { id: string } | string)

Source from the content-addressed store, hash-verified

148}
149
150export function getCachedEnvironment(interpreter?: { id: string } | string) {
151 if (!interpreter) {
152 return;
153 }
154 if (!pythonApi) {
155 throw new WrappedError('Python API not initialized', undefined, 'pythonAPINotInitialized');
156 }
157 if (typeof interpreter === 'string') {
158 return pythonApi.environments.known.find(
159 // eslint-disable-next-line local-rules/dont-use-fspath
160 (i) => i.id === interpreter || i.path === interpreter || i.executable.uri?.fsPath === interpreter
161 );
162 }
163 return pythonApi.environments.known.find((i) => i.id === interpreter.id);
164}
165
166export async function getSysPrefix(interpreter?: { id: string }) {
167 if (!interpreter?.id) {

Calls

no outgoing calls

Tested by

no test coverage detected