docs: require Python 3.10 for obfuscated lib; prefer Ubuntu 22.04

Reject 3.12+ in setup_env to avoid bad marshal data on new servers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-18 12:15:21 +08:00
parent 1d2bdc3aa1
commit af0fbc3e6f
6 changed files with 53 additions and 15 deletions
+17 -2
View File
@@ -63,6 +63,15 @@ should_include() {
}
find_python() {
# 用户版加密 lib 按 3.10 打包;优先明确版本,避免 Ubuntu 24.04 的 python3=3.12
if command -v python3.10 >/dev/null 2>&1; then
echo python3.10
return
fi
if command -v python3.11 >/dev/null 2>&1; then
echo python3.11
return
fi
if command -v python3 >/dev/null 2>&1; then
echo python3
return
@@ -71,7 +80,7 @@ find_python() {
echo python
return
fi
echo "未找到 python3/python,请先安装 Python 3.10+" >&2
echo "未找到 python3.10/python3.11/python3,请先安装 Python 3.10(推荐 Ubuntu 22.04)" >&2
exit 1
}
@@ -83,7 +92,13 @@ check_python_version() {
major="${ver%%.*}"
minor="${ver#*.}"
if [[ "${major}" -lt 3 ]] || [[ "${major}" -eq 3 && "${minor}" -lt 10 ]]; then
echo "需要 Python 3.10+,当前: ${ver}" >&2
echo "需要 Python 3.10 或 3.11(推荐 3.10),当前: ${ver}" >&2
exit 1
fi
if [[ "${major}" -eq 3 && "${minor}" -ge 12 ]]; then
echo "用户版加密核心包不支持 Python ${ver}(会出现 bad marshal data)。" >&2
echo "请改用 Ubuntu 22.04,或安装 python3.10 后重新执行本脚本。" >&2
echo "说明见 docs/ubuntu-server.md" >&2
exit 1
fi
echo "Python: $("${py}" --version 2>&1)"