Skip to content

Commit a1ee14d

Browse files
Rollup merge of rust-lang#151993 - crazazy:uv-support, r=jieyouxu
Add uv to the list of possible python runners Fixes the unlikely case that one has uv, but not python, globally installed (It's me, I'm the unlikely case)
2 parents 7ee4594 + fd023cb commit a1ee14d

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

x

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@ xpy=$(dirname "$(realpath "$0")")/x.py
2929
# On MacOS, `py` tries to install "Developer command line tools". Try `python3` first.
3030
# NOTE: running `bash -c ./x` from Windows doesn't set OSTYPE.
3131
case ${OSTYPE:-} in
32-
cygwin*|msys*) SEARCH="py python3 python python2";;
33-
*) SEARCH="python3 python py python2";;
32+
cygwin*|msys*) SEARCH="py python3 python python2 uv";;
33+
*) SEARCH="python3 python py python2 uv";;
3434
esac
3535
for SEARCH_PYTHON in $SEARCH; do
3636
if python=$(command -v $SEARCH_PYTHON) && [ -x "$python" ]; then
37-
if [ $SEARCH_PYTHON = py ]; then
38-
extra_arg="-3"
39-
else
40-
extra_arg=""
41-
fi
37+
case $SEARCH_PYTHON in
38+
py)
39+
extra_arg="-3";;
40+
uv)
41+
extra_arg="run";;
42+
*)
43+
extra_arg="";;
44+
esac
4245
exec "$python" $extra_arg "$xpy" "$@"
4346
fi
4447
done

0 commit comments

Comments
 (0)