Skip to content

Comments

uv run tries executing script if installed#9722

Closed
2022tgoel wants to merge 2 commits intoastral-sh:mainfrom
2022tgoel:tarushii/run_script
Closed

uv run tries executing script if installed#9722
2022tgoel wants to merge 2 commits intoastral-sh:mainfrom
2022tgoel:tarushii/run_script

Conversation

@2022tgoel
Copy link

Summary

This PR implements a solution to #9167. It prioritizes executing the uv run command 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 foo now executes the python script.

@zanieb
Copy link
Member

zanieb commented Feb 12, 2025

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.

@zanieb
Copy link
Member

zanieb commented Feb 12, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants