From 8d99f7e10f1163309e57939273f306a187d60840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Tue, 29 Sep 2026 17:15:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20server=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E9=A1=B9=E7=9B=AEvenv=E8=A7=A3=E9=87=8A=E5=99=A8?= =?UTF-8?q?=E2=80=94=E2=80=94=E7=B3=BB=E7=BB=9FPython=E6=97=A0django?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=A6=96=E9=AA=8C=E5=8D=B3=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- deploy/deploy.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 230cef7..38a900c 100644 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -58,10 +58,17 @@ preflight() { } # ---- 各目标实现 ---- +# server 测试解释器:优先项目 venv(Windows Scripts/ 或 Linux bin/ 布局),退化到 PATH python +server_py() { + if [ -x "$REPO_DIR/server/.venv/Scripts/python.exe" ]; then echo "$REPO_DIR/server/.venv/Scripts/python.exe" + elif [ -x "$REPO_DIR/server/.venv/bin/python" ]; then echo "$REPO_DIR/server/.venv/bin/python" + else echo python; fi +} server_tests() { [ "$SKIP_TESTS" -eq 1 ] && return 0 STEP="server 测试" - (cd "$REPO_DIR/server" && python -m pytest tracker/tests/ -q >>"$LOG_FILE" 2>&1) \ + local py; py="$(server_py)" + (cd "$REPO_DIR/server" && "$py" -m pytest tracker/tests/ -q >>"$LOG_FILE" 2>&1) \ || die "pytest 未全过(详见 $LOG_FILE)" ok "pytest 全过" }