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.
This commit is contained in:
Jan Čermák 2025-02-18 18:44:37 +01:00 committed by GitHub
parent 3bc55c054a
commit 249464e928
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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