microsoft / microsoft/vscode-python-environments

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

オープン
#1,281 コメント 1 件 リアクション 47 件 担当者 2 名 @anthonykim1 が担当を希望しています GitHub で見る
area-environment feature-request help wanted needs community feedback
主要言語
TypeScript
スター
138
フォーク
62
平均マージ
1日 4時間
マージ済み PR(30日)
35

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。