Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to run scripts without needing to use 'uv run' #10015

Closed
sandenbergmelo opened this issue Dec 19, 2024 · 2 comments
Closed

Add an option to run scripts without needing to use 'uv run' #10015

sandenbergmelo opened this issue Dec 19, 2024 · 2 comments
Labels
question Asking for clarification or support wontfix This will not be worked on

Comments

@sandenbergmelo
Copy link

It would be more practical if uv had an option to run Python files without needing to use the run command explicitly.

Like this:
uv example.py
As an alternative to:
uv run example.py

@zanieb
Copy link
Member

zanieb commented Dec 19, 2024

Sorry, but I don't think we will be doing this. We might add a Python shim that let's you do python example.py (#6265) but uv <file> seems too ambiguous given the amount of other things uv can do.

@samypr100 samypr100 added question Asking for clarification or support wontfix This will not be worked on labels Dec 19, 2024
@rgwood-dd
Copy link

Another option: if you're on a *nix system you can use a shebang.

Make this the first line of example.py:

#!/usr/bin/env -S uv run

Make sure example.py is executable:

chmod +x example.py

And then run it directly:

./example.py

@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants