From 3ccdd4d179842c095e657bcaa312e5342ab69b2c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 24 May 2024 22:59:42 +0200 Subject: [PATCH] Updated `pip ... --break-system-packages` configuration. All the latest versions of Alpine, Debian, Ubuntu and Fedora now require `--break-system-packages` when installing packages via `pip` outside of a virtual environment, even if it's within a container. --- platypush/install/docker/alpine.Dockerfile | 2 +- platypush/install/docker/debian.Dockerfile | 3 ++- platypush/install/docker/fedora.Dockerfile | 3 ++- platypush/install/docker/ubuntu.Dockerfile | 3 ++- platypush/utils/manifest.py | 5 +---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platypush/install/docker/alpine.Dockerfile b/platypush/install/docker/alpine.Dockerfile index 30aa9d013..e0a903d29 100644 --- a/platypush/install/docker/alpine.Dockerfile +++ b/platypush/install/docker/alpine.Dockerfile @@ -8,7 +8,7 @@ ENV DOCKER_CTX=1 RUN apk update && \ /install/platypush/install/scripts/alpine/install.sh && \ - cd /install && pip install -U --no-input --no-cache-dir . && \ + cd /install && pip install -U --no-input --no-cache-dir . --break-system-packages && \ rm -rf /install && \ apk cache clean diff --git a/platypush/install/docker/debian.Dockerfile b/platypush/install/docker/debian.Dockerfile index 80053c771..2608e9382 100644 --- a/platypush/install/docker/debian.Dockerfile +++ b/platypush/install/docker/debian.Dockerfile @@ -10,7 +10,8 @@ ENV DOCKER_CTX=1 RUN apt update && \ /install/platypush/install/scripts/debian/install.sh && \ - cd /install && pip install -U --no-input --no-cache-dir . --break-system-packages && \ + cd /install && \ + pip install -U --no-input --no-cache-dir . --break-system-packages && \ rm -rf /install && \ apt autoclean -y && \ apt autoremove -y && \ diff --git a/platypush/install/docker/fedora.Dockerfile b/platypush/install/docker/fedora.Dockerfile index fd3b147ca..3b6dd2c26 100644 --- a/platypush/install/docker/fedora.Dockerfile +++ b/platypush/install/docker/fedora.Dockerfile @@ -9,7 +9,8 @@ ENV DOCKER_CTX=1 # Enable the RPM Fusion repository RUN dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \ /install/platypush/install/scripts/fedora/install.sh && \ - cd /install && pip install -U --no-input --no-cache-dir . && \ + cd /install && \ + pip install -U --no-input --no-cache-dir . --break-system-packages && \ rm -rf /install && \ dnf clean all -y diff --git a/platypush/install/docker/ubuntu.Dockerfile b/platypush/install/docker/ubuntu.Dockerfile index 643f94dc3..36ee03f49 100644 --- a/platypush/install/docker/ubuntu.Dockerfile +++ b/platypush/install/docker/ubuntu.Dockerfile @@ -10,7 +10,8 @@ ENV DOCKER_CTX=1 RUN apt update && \ /install/platypush/install/scripts/debian/install.sh && \ - cd /install && pip install -U --no-input --no-cache-dir . && \ + cd /install && \ + pip install -U --no-input --no-cache-dir . --break-system-packages && \ rm -rf /install && \ apt autoclean -y && \ apt autoremove -y && \ diff --git a/platypush/utils/manifest.py b/platypush/utils/manifest.py index 11c6bbce0..c55910916 100644 --- a/platypush/utils/manifest.py +++ b/platypush/utils/manifest.py @@ -454,11 +454,8 @@ class Dependencies: through another script. """ wants_break_system_packages = not ( - # Docker installations shouldn't require --break-system-packages in - # pip, except for Debian - (self._is_docker and self.base_image != BaseImage.DEBIAN) # --break-system-packages has been introduced in Python 3.10 - or sys.version_info < (3, 11) + sys.version_info < (3, 11) # If we're in a virtual environment then we don't need # --break-system-packages or self._is_venv