uv icon indicating copy to clipboard operation
uv copied to clipboard

Add support for environment detection to VSCode

Open zanieb opened this issue 1 year ago • 7 comments

This is probably not relevant for us yet, but I want to track contributing this.

e.g.

  • https://github.com/microsoft/vscode-python/pull/15765
  • https://github.com/microsoft/vscode-python/pull/22779

zanieb avatar Jan 28 '24 16:01 zanieb

Actually it would be really appreciated feature, I have been already struggling with this

casellimarco avatar Feb 19 '24 12:02 casellimarco

I am noticing that uv's .venv folder is not detected by vscode.

Oddly, the .venv folder produced by poetry and pdm do get detected and the venv is auto-activated within the integrated terminal of vscode.

Edit: Seems this was a fluke. It's being found by vscode now!

chrisrodrigue avatar Aug 02 '24 22:08 chrisrodrigue

Huh, interesting. There's nothing special about our .venv!

charliermarsh avatar Aug 02 '24 22:08 charliermarsh

I just try it with VSCodium but it does auto-activated the venv.

eth3lbert avatar Aug 02 '24 23:08 eth3lbert

Would be very useful. is there any workaround for this?

ophiry avatar Sep 20 '24 07:09 ophiry

I also had issues on linux with that, on my side the problem was that I installed vscode/vscodium from a flatpak. Installing from a regular package manager solved the issues. I just select the python interpreter from vscode and it detects all the installed packages in the .venv folder. However I am unable to create from vscode a .venv environemnt using uv.

mark-kazakov avatar Sep 25 '24 07:09 mark-kazakov

What might be nice is smart handling of script dependency metadata.

image

merlinz01 avatar Oct 10 '24 00:10 merlinz01

We added environment detection to python-environment-tools which is the backing source for VS Code.

I think there's more to be done for PEP 723 scripts, but I consider that separate from the intent of this issue.

cc @zsol

zanieb avatar Dec 02 '25 10:12 zanieb