Skip to content

Commit 9595936

Browse files
committed
chore: fix uv only install
1 parent 4fc5f33 commit 9595936

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

setup.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function echo_block() {
66
echo $1
77
echo "----------------------------"
88
}
9+
UV=false
910

1011
function check_installed_pip() {
1112
${PYTHON} -m pip > /dev/null
@@ -24,6 +25,13 @@ function check_installed_python() {
2425
echo "You can do this by running 'deactivate'."
2526
exit 2
2627
fi
28+
if [ -x "$(command -v uv)" ]; then
29+
echo "uv detected — using it instead of pip for faster installation."
30+
PIP="uv pip"
31+
PYTHON="python3.13"
32+
UV=true
33+
return
34+
fi
2735

2836
for v in 13 12 11
2937
do
@@ -33,10 +41,6 @@ function check_installed_python() {
3341
echo "using ${PYTHON}"
3442
check_installed_pip
3543
PIP="${PYTHON} -m pip"
36-
if [ -x "$(command -v uv)" ]; then
37-
echo "uv detected — using it instead of pip for faster installation."
38-
PIP="uv pip"
39-
fi
4044
return
4145
fi
4246
done
@@ -184,7 +188,12 @@ function recreate_environments() {
184188
fi
185189

186190
echo
187-
${PYTHON} -m venv .venv
191+
if [ "$UV" = true ] ; then
192+
echo "- Creating new virtual environment with uv"
193+
uv venv .venv --python=${PYTHON}
194+
else
195+
${PYTHON} -m venv .venv
196+
fi
188197
if [ $? -ne 0 ]; then
189198
echo "Could not create virtual environment. Leaving now"
190199
exit 1

0 commit comments

Comments
 (0)