Migrate release runtime and gates to Python 3.14

This commit is contained in:
anor
2026-11-28 00:41:25 +10:00
parent a0de4659f1
commit 3af59574f3
41 changed files with 305 additions and 106 deletions
+7 -4
View File
@@ -9,6 +9,7 @@
set -uo pipefail
APP_DIR="${APP_DIR:-/home/mcp-user/smeta-web}"
COPY_DIR="${COPY_DIR:-/home/mcp-user/smeta-web-predeploy}"
PYTHON_BIN="${PYTHON_BIN:-python3}"
cd "$APP_DIR" || exit 1
HEAD_NOW="$(git rev-parse HEAD)"
echo "HEAD: $HEAD_NOW"
@@ -31,15 +32,17 @@ FAIL=0
touch "$COPY_DIR/tests/__init__.py"
export PYTHONPATH="$COPY_DIR${PYTHONPATH:+:$PYTHONPATH}"
echo "--- компиляция:"
python3 -m py_compile main.py db.py auth.py health_checks.py || FAIL=1
PYTHON_INFO=$("$PYTHON_BIN" -c 'import sys; print("python:", sys.version.split()[0], sys.executable)') || FAIL=1
echo "gate $PYTHON_INFO"
"$PYTHON_BIN" -m py_compile main.py db.py auth.py health_checks.py || FAIL=1
echo "--- круг без браузера:"
python3 -m pytest tests -q -m "not ui" --tb=line || FAIL=1
"$PYTHON_BIN" -m pytest tests -q -m "not ui" --tb=line || FAIL=1
echo "--- браузерный круг:"
python3 -m pytest tests -q -m "ui" --tb=line || FAIL=1
"$PYTHON_BIN" -m pytest tests -q -m "ui" --tb=line || FAIL=1
df --output=avail -h "$HOME" | tail -1 | sed 's/^/свободно в домашнем после: /'
if [ "$FAIL" != 0 ]; then
echo "ПРОВЕРКИ КРАСНЫЕ — выкат запрещён, след не пишется" >&2
exit 1
fi
printf "%s\n%s\n%s\n" "$HEAD_NOW" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "full: not-ui+ui" > "$APP_DIR/.predeploy-stamp"
printf "%s\n%s\n%s\n%s\n" "$HEAD_NOW" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "full: not-ui+ui" "$PYTHON_INFO" > "$APP_DIR/.predeploy-stamp"
echo "СЛЕД НАПИСАН: полные проверки зелёные на копии HEAD $HEAD_NOW"