uv run tries executing script if installed#9722
Closed
2022tgoel wants to merge 2 commits intoastral-sh:mainfrom
Closed
uv run tries executing script if installed#97222022tgoel wants to merge 2 commits intoastral-sh:mainfrom
uv run tries executing script if installed#97222022tgoel wants to merge 2 commits intoastral-sh:mainfrom
Conversation
Member
|
Sorry I didn't get to reviewing this — I looked at it and wasn't sure what to think of the approach and figured I'd need to play with it myself to make a suggestion. I just found the time to try implementing the feature and landed on #11431 I think this approach is theoretically better, but I decided to go with the simpler practical approach for now. |
Member
|
Thank you for taking the time to contribute though, it saved me time to not need to implement this to see how it looked. |
loic-lescoat
pushed a commit
to loic-lescoat/uv
that referenced
this pull request
Mar 2, 2025
…me>/__main__.py` (astral-sh#11431) Closes astral-sh#11423 Closes astral-sh#9167 Closes astral-sh#9722 astral-sh@c23fc40 demonstrates the behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a solution to #9167. It prioritizes executing the
uv runcommand as a python script, if the script is installed, over executing the command as a python package or external command.Test Plan
I tested my solution against the repoduction of the issue created here: https://github.com/raqbit/uv-scripts-repro/, and verified that
uv run foonow executes the python script.