Skip to content

Conversation

@austin3dickey
Copy link
Contributor

@austin3dickey austin3dickey commented Dec 18, 2025

Addresses #8870. Changes the UVInstaller so it uses uv add instead of uv pip install if

  • you're in a workspace with a pyproject.toml at the root
  • it's not installing ipykernel
  • it's not using the --break-system-packages flag, which isn't supported by uv add, and is only tried on the second iteration anyway in most cases

This will mainly be used by Assistant's install python package tool if you have uv installed, but also could be used in certain app workflows.

Should this be a setting?

Release Notes

New Features

  • Assistant will now use uv add when appropriate when installing python packages

Bug Fixes

  • N/A

QA Notes

Try

  • asking assistant to install something when all those criteria are met
  • asking when they're not all met
    • e.g. try setting "python.useBundledIpykernel": false and install ipykernel and make sure it didn't use uv add

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@austin3dickey
Copy link
Contributor Author

austin3dickey commented Dec 18, 2025

This is ready for review (or at least opinions on whether this is a good idea) but I put it in "draft" mode because I don't want to merge right before I go on holiday break. I'll probably end up merging after we cut 2026.01, so we can have all of January to test it out.

I'll fix the failing tests when I get back, they just need more mocks.

This comment was marked as resolved.

const proxy = workspaceService.getConfiguration('http').get('proxy', '');
if (proxy.length > 0) {
args.push('--proxy', proxy);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I realized that uv doesn't support this --proxy argument, only pip does. I probably should make an issue and tackle that later.


if (flags & ModuleInstallFlags.reInstall) {
args.push('--force-reinstall');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here - uv doesn't support this argument.

const configService = this.serviceContainer.get<IConfigurationService>(IConfigurationService);
const settings = configService.getSettings(isResource(resource) ? resource : undefined);
const interpreterService = this.serviceContainer.get<IInterpreterService>(IInterpreterService);
const interpreter = isResource(resource) ? await interpreterService.getActiveInterpreter(resource) : resource;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh, I think getActiveInterpreter() still sometimes returns the wrong one in certain workspaceless scenarios. That's a bigger problem than this PR so I'll make an issue later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

related to #6936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants