microsoft / microsoft/vscode-python-environments

Support `uv run` as an optional default run action.

Aperta
#1,281 1 commento 47 reazioni 2 assegnatari Vedi su GitHub

@anthonykim1 ci sta già lavorando.

Dal 13/3/2026.

area-environment feature-request help wanted needs community feedback
Lingua principale
TypeScript
Stelle
138
Fork
62
Merge medio
1g 4h
PR unite (30g)
35

Descrizione

Currently, the Run Python File in Terminal play button (and the default python debugger) is hardcoded to run the current python file using the activated environment.

For [uv scripts with dependencies](https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies) this causes an issue.

If it were possible to configure this as a setting to run using `uv run ${file}` instead, it would allow seamless integration for rust scripts, same for the debugger.

I've come from related issues: https://github.com/astral-sh/uv/issues/8558, https://github.com/astral-sh/uv/issues/7803, and https://github.com/astral-sh/ty-vscode/issues/353, but realised it's not possible to implement this feature anywhere other than the vscode-python repo.

Debugging can work with a custom launch.json specifying `uv run --with-requirments ${file} python`, but this has the caveat that it will fail for scripts with no inline dependencies defined. Being able to use just `uv run` as the actual command would allow it to always work. Though my guess is this requires work on debugpy itself to better support uv.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.