Fix flask-compress not installing into venv

The core pip install was suppressing errors with 2>/dev/null, and the
verification check was finding packages in ~/.local/site-packages
instead of the venv. When run with sudo, ~/.local isn't visible,
causing the flask-compress warning.

- Remove --quiet and stderr suppression from core package install
- Use python -s flag in verification to ignore user site-packages
- Update health check to also verify flask-compress and flask-wtf

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-03-16 11:20:17 +00:00
parent c0138ed849
commit ddf23377c3

View File

@@ -530,11 +530,12 @@ install_python_deps() {
progress "Installing Python dependencies"
info "Installing core packages..."
$PIP install --quiet "flask>=3.0.0" "flask-wtf>=1.2.0" "flask-compress>=1.15" \
$PIP install "flask>=3.0.0" "flask-wtf>=1.2.0" "flask-compress>=1.15" \
"flask-limiter>=2.5.4" "requests>=2.28.0" \
"Werkzeug>=3.1.5" "pyserial>=3.5" 2>/dev/null || true
"Werkzeug>=3.1.5" "pyserial>=3.5" || true
$PY -c "import flask; import requests; from flask_limiter import Limiter; import flask_compress; import flask_wtf" 2>/dev/null || {
# Verify core packages are importable from the venv (not user site-packages)
$PY -s -c "import flask; import requests; from flask_limiter import Limiter; import flask_compress; import flask_wtf" 2>/dev/null || {
fail "Critical Python packages (flask, requests, flask-limiter, flask-compress, flask-wtf) not installed"
echo "Try: venv/bin/pip install flask requests flask-limiter flask-compress flask-wtf"
exit 1
@@ -2013,8 +2014,8 @@ do_health_check() {
ok "Python venv exists"
((pass++)) || true
if venv/bin/python -c "import flask; import requests" 2>/dev/null; then
ok "Critical Python packages (flask, requests) — OK"
if venv/bin/python -s -c "import flask; import requests; import flask_compress; import flask_wtf" 2>/dev/null; then
ok "Critical Python packages (flask, requests, flask-compress, flask-wtf) — OK"
((pass++)) || true
else
fail "Critical Python packages missing in venv"