Skip to content

Configure Python Env tool #25091

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

Merged
merged 9 commits into from
May 20, 2025
Merged

Configure Python Env tool #25091

merged 9 commits into from
May 20, 2025

Conversation

DonJayamanne
Copy link

No description provided.

}
},
{
"name": "list_python_packages",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this tool, was disabled

@DonJayamanne DonJayamanne added no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary skip-issue-check labels May 20, 2025
@@ -103,10 +103,11 @@ export function registerCreateEnvironmentFeatures(
registerCreateEnvironmentProvider(condaCreationProvider()),
onCreateEnvironmentExited(async (e: EnvironmentDidCreateEvent) => {
if (e.path && e.options?.selectEnvironment) {
await interpreterPathService.update(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig Found that this is another place where user action results in updating the Python path.
Instead of injecting another dependency, I decided to use the more generic one that is responsible for all updates to python path,


async activate(_resource: Resource, _startupStopWatch?: StopWatch): Promise<void> {
this.extensionContext.subscriptions.push(
commands.registerCommand('python.getRecommendedEnvironment', async (resource: Resource) => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a command, I think command is simpler as Jupyter and Python Env extension will need this API.

@@ -569,7 +569,10 @@ export class SetInterpreterCommand extends BaseInterpreterSelectorCommand implem
* @returns true when an interpreter was set, undefined if the user cancelled the quickpick.
*/
@captureTelemetry(EventName.SELECT_INTERPRETER)
public async setInterpreter(): Promise<true | undefined> {
public async setInterpreter(options?: {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig I added back button and actions into the interpreter quick pick

resourcePath?: string;
}

export class ListPythonPackagesTool implements LanguageModelTool<IResourceReference> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not required

@DonJayamanne DonJayamanne marked this pull request as ready for review May 20, 2025 03:17
@vs-code-engineering vs-code-engineering bot added this to the May 2025 milestone May 20, 2025
@DonJayamanne DonJayamanne merged commit 4a602e8 into main May 20, 2025
85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog No news entry required skip package*.json package.json and package-lock.json don't both need updating skip tests Updates to tests unnecessary skip-issue-check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants