Skip to content

Commit

Permalink
Update API to return the exe
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Dec 29, 2024
1 parent a924a45 commit 15dfed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
19 changes: 6 additions & 13 deletions src/api.proposed.notebookEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,11 @@ declare module './api' {
* @param uri
*/
getPythonEnvironment(uri: Uri):
| undefined
| {
/**
* The ID of the environment.
*/
readonly id: string;
/**
* Path to environment folder or path to python executable that uniquely identifies an environment. Environments
* lacking a python executable are identified by environment folder paths, whereas other envs can be identified
* using python executable path.
*/
readonly path: string;
};
| undefined /**
* Path to environment folder or path to python executable that uniquely identifies an environment. Environments
* lacking a python executable are identified by environment folder paths, whereas other envs can be identified
* using python executable path.
*/
| string;
}
}
5 changes: 3 additions & 2 deletions src/standalone/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ export function buildApi(
onDidChangePythonEnvironment: envApi.onDidChangeEnvironment,
// Only for use By Python, hence this is proposed API and can change anytime.
// Do not add this to Kernels or other namespaces, as this is only for Python.
getPythonEnvironment(uri: Uri): EnvironmentPath | undefined {
getPythonEnvironment(uri: Uri): string | undefined {
// This is a proposed API that is only used by the Python extension.
// Hence the reason to keep this separate.
// This way we can keep the API stable for other extensions (which would be the majority case).
return envApi.getPythonEnvironment(uri);
// eslint-disable-next-line local-rules/dont-use-fspath
return envApi.getPythonEnvironment(uri)?.executable?.uri?.fsPath;
}
};

Expand Down

0 comments on commit 15dfed0

Please sign in to comment.