Skip to content

Commit 3a8f16d

Browse files
authored
Merge pull request #18 from nahuhh/update-uv-venv
update: python 3.13
2 parents 6349ada + e422cd1 commit 3a8f16d

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

basicswap-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export MACOS="${MACOS}"
286286

287287
## Create venv
288288
if [[ $(type -p uv) ]]; then
289-
uv venv -p 3.12 "${SWAP_DATADIR}/venv" --seed
289+
uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed
290290
else
291291
python3 -m venv "${SWAP_DATADIR}/venv"
292292
fi

bsx/shared.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export TOR_DNS_PORT=15353
1010
export BSX_LOCAL_TOR=true # sets host to 127.0.0.1
1111
export BSX_ALLOW_ENV_OVERRIDE=true # required to change the ports
1212

13+
# Python vwrsion
14+
export py_maj=3
15+
export py_min=13
16+
1317
# Network
1418
[[ "${1}${2}${3}${4}${5}" == *"regtest"* ]] && export regtest="--regtest"
1519

bsx/update.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
source bsx/shared.sh
23

34
# Move scripts
45
rm -r $HOME/.local/bin/bsx $HOME/.local/bin/basicswap-*
@@ -8,6 +9,16 @@ echo "Updating BasicSwapDEX" && sleep 1
89
# Delete dangling build folder. Same as --no-cache for docker
910
rm -rf $SWAP_DATADIR/basicswap/build
1011

12+
# Check and update UV python version
13+
if type -p uv; then
14+
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+
rm -rf venv
17+
green "Updating uv Python to ${py_maj}.${py_min}"
18+
uv venv -p ${py_maj}.${py_min} "${SWAP_DATADIR}/venv" --seed
19+
fi
20+
fi
21+
1122
# BasicSwap, coincurve, and dependencies
1223
# Switch to new repo: basicswap/basicswap
1324
cd $SWAP_DATADIR/basicswap

0 commit comments

Comments
 (0)