You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow configuring a custom runner command e.g., uv run for the Play button #26319
Allow users to configure a custom runner or launcher prefix such as uv run, poetry run, pipenv run, or a custom wrapper command in settings.json for the editor Run play button when executing Python files, even when a virtual environment .venv is already detected.
Motivation
Many Python developers use modern package and project managers like uv and rely on commands such as uv run python <file>.py or uv run <file>.py so that dependencies, environment variables, and project metadata stay automatically synced with pyproject.toml and uv.lock.
Currently, clicking the top-right Run button executes the selected Python interpreter binary directly in the terminal rather than routing through the project's runner. Because of this, uv users miss automatic environment synchronization and runner-level behaviour, making the Run button unreliable or unhelpful in uv-managed workflows.
Proposed Solution
Add a setting in settings.json configurable at both User and Workspace/Folder levels that lets users specify a runner prefix or command template for the Run action.
Example configuration prefix style:
{
"python.run.commandPrefix": ["uv", "run"]
}
Alternative configuration template style:
{
"python.run.commandTemplate": "uv run ${file}"
}
Expected Behaviour
When unset default: Preserves existing behaviour by executing the currently selected Python interpreter directly.
When set: Prepends or wraps the execution command triggered by the Run button with the configured runner e.g., running uv run /path/to/script.py in the integrated terminal.
Additional Context
Supporting this via settings.json allows seamless switching across workspaces for example, using uv run in one project, poetry run in another, and standard .venv execution in others without changing global habits.
Activity