Skip to content

Revert "add uv to interpreters list" - #513

Merged
asottile merged 1 commit into
mainfrom
revert-503-uv-interpreter
Mar 8, 2025
Merged

asottile merged 1 commit into
mainfrom
revert-503-uv-interpreter

Conversation

@asottile

@asottile asottile commented Mar 6, 2025 •

Copy link
Copy Markdown
Member

Reverts #503

resolves #512

@asottile
asottile merged commit d7518a7 into main Mar 8, 2025
@asottile
asottile deleted the revert-503-uv-interpreter branch March 8, 2025 15:53
@OJFord

OJFord commented Jul 3, 2025

Copy link
Copy Markdown

This is unfortunate - could we instead match uv run --script or uv run python to keep #503 behaviour?

It's only because of the 'bash' in #512 (uv run bash essentially) that it's not a python script; I'm sure the more common case will be people using uv run --script for isolated python scripts with dependencies like:

#!/usr/bin/env -S uv run --script
# /// script
# dependencies = ["boto3"]
# ///
import boto3

assert boto3.client("s3")

@OJFord

OJFord commented Jul 3, 2025

Copy link
Copy Markdown

Workaround I think is to use env -S python -m uv run --script, but that's a bit silly and non-obviously important.

@teobouvard

Copy link
Copy Markdown

Workaround I think is to use env -S python -m uv run --script

This does not work when uv is installed through a package manager, not with pip (No module named uv). It would be nice to have #!/usr/bin/env -S uv run --script be identified as Python.

@pre-commit pre-commit locked as off-topic and limited conversation to collaborators Mar 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Shebang #!/usr/bin/env -S uv run bash incorrectly detected as python

3 participants