From 249464e92867332b7bb658e6ae74fbe5eaafb817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Tue, 18 Feb 2025 18:44:37 +0100 Subject: [PATCH] Generate Python bytecode for site-packages during build (#5640) Since transition from pip to uv in #5152, Supervisor container doesn't contain bytecode for site-packages anymore, and because our AppArmor profile denies mkdir operations, the compiled *.pyc files are never created. Enable uv --compile option to opt for the same behavior as pip had, to fix of the AA errors and the potential penalty of compilation on every import. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a0aef027..6015aa4cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,9 +34,9 @@ RUN \ COPY requirements.txt . RUN \ if [ "${BUILD_ARCH}" = "i386" ]; then \ - linux32 uv pip install --no-build -r requirements.txt; \ + linux32 uv pip install --compile --no-build -r requirements.txt; \ else \ - uv pip install --no-build -r requirements.txt; \ + uv pip install --compile --no-build -r requirements.txt; \ fi \ && rm -f requirements.txt