test fix import ndpi
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 1m40s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 1m40s
This commit is contained in:
@@ -88,6 +88,25 @@ if [ -d "/tmp/nDPI/python" ]; then
|
||||
pip install "setuptools<81" "packaging<25" wheel
|
||||
if ! pip install --no-build-isolation /tmp/nDPI/python; then
|
||||
echo "==> WARNING: nDPI Python bindings install failed, backend will run without DPI enrichment"
|
||||
else
|
||||
if python - <<'PY'
|
||||
import importlib
|
||||
mods = []
|
||||
for name in ("ndpi", "pyndpi"):
|
||||
try:
|
||||
m = importlib.import_module(name)
|
||||
mods.append((name, getattr(m, "__file__", "unknown")))
|
||||
except Exception:
|
||||
pass
|
||||
if not mods:
|
||||
raise SystemExit(1)
|
||||
print("nDPI Python modules:", mods)
|
||||
PY
|
||||
then
|
||||
echo "==> nDPI Python import check passed"
|
||||
else
|
||||
echo "==> WARNING: nDPI installed but import failed in backend venv"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -234,6 +253,18 @@ if [ -d "/tmp/nDPI/python" ]; then
|
||||
pip install "setuptools<81" "packaging<25" wheel
|
||||
if ! pip install --no-build-isolation /tmp/nDPI/python; then
|
||||
echo "WARNING: nDPI Python bindings install failed during runner build"
|
||||
else
|
||||
python - <<'PY' || echo "WARNING: nDPI import check failed during runner build"
|
||||
import importlib
|
||||
for name in ("ndpi", "pyndpi"):
|
||||
try:
|
||||
m = importlib.import_module(name)
|
||||
print("nDPI import OK:", name, getattr(m, "__file__", "unknown"))
|
||||
raise SystemExit(0)
|
||||
except Exception:
|
||||
pass
|
||||
raise SystemExit(1)
|
||||
PY
|
||||
fi
|
||||
fi
|
||||
pip install -r requirements.txt
|
||||
|
||||
Reference in New Issue
Block a user