try again setup codex
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 10s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 10s
This commit is contained in:
@@ -19,7 +19,7 @@ logger = logging.getLogger("ndpi_classifier")
|
||||
|
||||
ndpi = None # type: ignore
|
||||
_ndpi_import_error: Optional[str] = None
|
||||
for _module_name in ("ndpi", "pyndpi"):
|
||||
for _module_name in ("ndpi", "pyndpi", "nDPI"):
|
||||
try: # pragma: no cover - import depends on host runtime
|
||||
ndpi = importlib.import_module(_module_name) # type: ignore
|
||||
break
|
||||
|
||||
@@ -81,8 +81,29 @@ else
|
||||
echo "==> nDPI library already installed"
|
||||
fi
|
||||
|
||||
patch_ndpi_python_metadata() {
|
||||
local py_dir="$1"
|
||||
local patched=0
|
||||
if [ -f "$py_dir/pyproject.toml" ] && grep -q "PACK_ON" "$py_dir/pyproject.toml"; then
|
||||
sed -i 's/PACK_ON/"0.0.0"/g' "$py_dir/pyproject.toml"
|
||||
patched=1
|
||||
fi
|
||||
if [ -f "$py_dir/setup.cfg" ] && grep -q "PACK_ON" "$py_dir/setup.cfg"; then
|
||||
sed -i 's/PACK_ON/0.0.0/g' "$py_dir/setup.cfg"
|
||||
patched=1
|
||||
fi
|
||||
if [ -f "$py_dir/setup.py" ] && grep -q "PACK_ON" "$py_dir/setup.py"; then
|
||||
sed -i "s/PACK_ON/'0.0.0'/g" "$py_dir/setup.py"
|
||||
patched=1
|
||||
fi
|
||||
if [ "$patched" -eq 1 ]; then
|
||||
echo "==> Applied PACK_ON metadata workaround for nDPI python bindings"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -d "/tmp/nDPI/python" ]; then
|
||||
echo "==> Install nDPI Python bindings"
|
||||
patch_ndpi_python_metadata "/tmp/nDPI/python"
|
||||
# nDPI bindings currently fail with newer build backends on some hosts
|
||||
# (e.g. metadata parsing errors such as "cannot parse PACK_ON").
|
||||
pip install "setuptools<81" "packaging<25" wheel
|
||||
@@ -250,6 +271,7 @@ npm run build
|
||||
cd $BACKEND_DIR
|
||||
source venv/bin/activate
|
||||
if [ -d "/tmp/nDPI/python" ]; then
|
||||
patch_ndpi_python_metadata "/tmp/nDPI/python"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user