Skip to content

Commit 335cc39

Browse files
authored
Merge pull request #19 from nahuhh/switch-to-uv
update: migrate old debian-like installs to uv
2 parents 3a8f16d + c54a263 commit 335cc39

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

bsx/update.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,24 @@ 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 "Migrating venv to uv"
21+
if ! type -p pipx; then
22+
green "Need to install pipx dependency"
23+
$UPDATE
24+
sudo apt install pipx --no-install-recommends
25+
fi
26+
$PIPX_UV
27+
else
28+
green "Updating uv Python to ${py_maj}.${py_min}"
29+
fi
1630
rm -rf venv
17-
green "Updating uv Python to ${py_maj}.${py_min}"
1831
uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed
1932
fi
2033
fi

0 commit comments

Comments
 (0)