diff --git a/basicswap-install.sh b/basicswap-install.sh index 7da2db0..4a801b8 100755 --- a/basicswap-install.sh +++ b/basicswap-install.sh @@ -286,7 +286,7 @@ export MACOS="${MACOS}" ## Create venv if [[ $(type -p uv) ]]; then - uv venv -p 3.12 "${SWAP_DATADIR}/venv" --seed + uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed else python3 -m venv "${SWAP_DATADIR}/venv" fi diff --git a/bsx/shared.sh b/bsx/shared.sh index 4aaee22..20ada83 100755 --- a/bsx/shared.sh +++ b/bsx/shared.sh @@ -10,6 +10,10 @@ export TOR_DNS_PORT=15353 export BSX_LOCAL_TOR=true # sets host to 127.0.0.1 export BSX_ALLOW_ENV_OVERRIDE=true # required to change the ports +# Python vwrsion +export py_maj=3 +export py_min=13 + # Network [[ "${1}${2}${3}${4}${5}" == *"regtest"* ]] && export regtest="--regtest" diff --git a/bsx/update.sh b/bsx/update.sh index e476af7..30b95df 100755 --- a/bsx/update.sh +++ b/bsx/update.sh @@ -1,4 +1,5 @@ #!/bin/bash +source bsx/shared.sh # Move scripts rm -r $HOME/.local/bin/bsx $HOME/.local/bin/basicswap-* @@ -8,6 +9,16 @@ echo "Updating BasicSwapDEX" && sleep 1 # Delete dangling build folder. Same as --no-cache for docker rm -rf $SWAP_DATADIR/basicswap/build +# Check and update UV python version +if type -p uv; then + cd $SWAP_DATADIR + if uv run python -c "import sys; exit(0 if sys.version_info <= (${py_maj},${py_min}) else 1)"; then + rm -rf venv + green "Updating uv Python to ${py_maj}.${py_min}" + uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed + fi +fi + # BasicSwap, coincurve, and dependencies # Switch to new repo: basicswap/basicswap cd $SWAP_DATADIR/basicswap