Skip to content

Commit adbf1d2

Browse files
committed
update: migrate old installs to uv
1 parent e422cd1 commit adbf1d2

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

bsx/update.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,21 @@ echo "Updating BasicSwapDEX" && sleep 1
1010
rm -rf $SWAP_DATADIR/basicswap/build
1111

1212
# Check and update UV python version
13-
if type -p uv; then
13+
detect_os_arch
14+
if [[ $DEBIAN ]]; then
1415
cd $SWAP_DATADIR
15-
if uv run python -c "import sys; exit(0 if sys.version_info <= (${py_maj},${py_min}) else 1)"; then
16+
if ./venv/bin/python -c "import sys; exit(0 if sys.version_info >= (${py_maj},${py_min}) else 1)"; then
17+
green "Python in the venv is up to date"
18+
else
19+
if ! type -p uv; then
20+
green "Updating venv using pipx and uv"
21+
$UPDATE
22+
sudo apt install pipx --no-install-recommends
23+
$PIPX_UV
24+
else
25+
green "Updating uv Python to ${py_maj}.${py_min}"
26+
fi
1627
rm -rf venv
17-
green "Updating uv Python to ${py_maj}.${py_min}"
1828
uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed
1929
fi
2030
fi

0 commit comments

Comments
 (0)