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

Handle Ctrl-C properly in uvx #6334

Closed
zanieb opened this issue Aug 21, 2024 · 15 comments
Closed

Handle Ctrl-C properly in uvx #6334

zanieb opened this issue Aug 21, 2024 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@zanieb
Copy link
Member

zanieb commented Aug 21, 2024

As we do in uv run

@zanieb zanieb added the bug Something isn't working label Aug 21, 2024
@charliermarsh
Copy link
Member

The setup is identical for both commands, I think...? What are you seeing.

@zanieb
Copy link
Member Author

zanieb commented Aug 21, 2024

Oh. Mentioned at #6329 (comment) cc @bluss

@charliermarsh
Copy link
Member

Thanks I'll check it out. Maybe has to do with the wrapper? Not sure yet.

@bluss
Copy link
Contributor

bluss commented Aug 21, 2024

Thanks I'll check it out. Maybe has to do with the wrapper? Not sure yet.

That's a surprise, but it's the case, the problem is for uvx and not uv tool run.

@zanieb
Copy link
Member Author

zanieb commented Aug 21, 2024

Oh, we invoke uv tool run as a subprocess in uvx. We'll need to be more sophisticated there.

@charliermarsh
Copy link
Member

👍 👍

@prrao87
Copy link

prrao87 commented Aug 21, 2024

Hang on, is uvx fundamentally different from uv tool run in the sense that it's invoked as a subprocess?
The docs page here seems to indicate that it's simply an alias:
https://docs.astral.sh/uv/guides/tools/#running-tools

I'm now thoroughly confused when I should be using uvx vs. uv tool run 😅.

@charliermarsh
Copy link
Member

charliermarsh commented Aug 21, 2024

They're meant to be entirely equivalent. It's an "alias" but it's not literally a bash alias (since we don't have a way to "install" an alias), it's a tiny wrapper script that just forwards on to uv tool run.

@charliermarsh
Copy link
Member

Any perceptible or behavioral difference between uvx and uv tool run should be considered a bug.

@charliermarsh
Copy link
Member

(...like this one 😂)

@zanieb
Copy link
Member Author

zanieb commented Aug 21, 2024

There's a few additional ms of overhead — but yeah it's functionally an alias just can't trivially be implemented as a true shell alias. There are a few other minor differences, like we change the help menu to say uvx when you're using it.

@prrao87
Copy link

prrao87 commented Aug 21, 2024

I suppose what's confusing in the docs is that the top half of the tools docs page uses uvx and the bottom half switches to using uv tool run. I wonder if there's a clearer way to state that users can treat them as functionally equivalent, and have example commands that are consistent?
https://docs.astral.sh/uv/guides/tools/

@zanieb
Copy link
Member Author

zanieb commented Aug 21, 2024

@prrao87 I'm a bit confused, I don't think we switch to uv tool run, we switch to uv tool install which is different.

charliermarsh added a commit that referenced this issue Aug 21, 2024
## Summary

This follows Rye's approach, and solves
#6334.
@charliermarsh
Copy link
Member

Closed by #6346.

@prrao87
Copy link

prrao87 commented Aug 21, 2024

@zanieb I now understand it much better. Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants