Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API to return the exe #16347

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading