From 6b3412232f97e06c22814bec670fb61149189d8c Mon Sep 17 00:00:00 2001 From: flou Date: Wed, 31 Dec 2025 01:54:05 +0100 Subject: [PATCH] python: Add support for `uv run` as the shebang line (#45881) `uv run` can be used to specify a shebang for a Python script. See: https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file Release Notes: - Added support for `uv run` in the shebang line to be interpreted as a Python script --- crates/languages/src/python/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/python/config.toml b/crates/languages/src/python/config.toml index c58a54fc1cae78cfb3722e74008fe42c7a883851..d96a5ea5fefd0814c4b0787251e5cf6e4c166d5e 100644 --- a/crates/languages/src/python/config.toml +++ b/crates/languages/src/python/config.toml @@ -1,7 +1,7 @@ name = "Python" grammar = "python" path_suffixes = ["py", "pyi", "mpy"] -first_line_pattern = '^#!.*\bpython[0-9.]*\b' +first_line_pattern = '^#!.*((\bpython[0-9.]*\b)|(\buv run\b))' line_comments = ["# "] autoclose_before = ";:.,=}])>" brackets = [