Pass --ignore-installed to pip in most of the cases.

The only case where it's fine to overwrite existing Python packages with
pip versions is when Platypush is running in a virtual environment.

Otherwise, keep the system-installed version if it's available, unless
its version is explicitly incompatible with the one reported in
`requirements.txt`.
This commit is contained in:
Fabio Manganiello 2024-11-10 16:21:50 +01:00
parent b887122a7f
commit 38756119c4
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
5 changed files with 5 additions and 4 deletions

View file

@ -18,7 +18,7 @@ RUN --mount=type=bind,source=.,target=/curdir \
RUN /install/platypush/install/scripts/alpine/install.sh && \ RUN /install/platypush/install/scripts/alpine/install.sh && \
cd /install && \ cd /install && \
pip install -U --no-input --no-cache-dir --no-deps . croniter --break-system-packages && \ pip install -U --no-input --no-cache-dir --no-deps --ignore-installed --break-system-packages . croniter && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache && \ rm -rf /root/.cache && \
apk del gcc git && \ apk del gcc git && \

View file

@ -21,7 +21,7 @@ RUN --mount=type=bind,source=.,target=/curdir \
RUN /install/platypush/install/scripts/debian/install.sh && \ RUN /install/platypush/install/scripts/debian/install.sh && \
cd /install && \ cd /install && \
pip install -U --no-input --no-cache-dir --no-deps . --break-system-packages && \ pip install -U --no-input --no-cache-dir --no-deps --ignore-installed --break-system-packages . && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache && \ rm -rf /root/.cache && \
apt remove -y git build-essential && \ apt remove -y git build-essential && \

View file

@ -19,7 +19,7 @@ RUN --mount=type=bind,source=.,target=/curdir \
RUN /install/platypush/install/scripts/fedora/install.sh && \ RUN /install/platypush/install/scripts/fedora/install.sh && \
cd /install && \ cd /install && \
pip install -U --no-input --no-cache-dir --no-deps . --break-system-packages && \ pip install -U --no-input --no-cache-dir --no-deps --ignore-installed --break-system-packages . && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache && \ rm -rf /root/.cache && \
dnf remove -y build-essential git && \ dnf remove -y build-essential git && \

View file

@ -21,7 +21,7 @@ RUN --mount=type=bind,source=.,target=/curdir \
RUN /install/platypush/install/scripts/debian/install.sh && \ RUN /install/platypush/install/scripts/debian/install.sh && \
cd /install && \ cd /install && \
pip install -U --no-input --no-cache-dir --no-deps . --break-system-packages && \ pip install -U --no-input --no-cache-dir --no-deps --ignore-installed --break-system-packages . && \
rm -rf /install && \ rm -rf /install && \
rm -rf /root/.cache && \ rm -rf /root/.cache && \
apt remove -y git \ apt remove -y git \

View file

@ -475,6 +475,7 @@ class Dependencies:
yield ( yield (
'pip install -U --no-input ' 'pip install -U --no-input '
+ ('--no-cache-dir ' if self._is_docker else '') + ('--no-cache-dir ' if self._is_docker else '')
+ ('--ignore-installed ' if not self._is_venv else '')
+ ( + (
'--break-system-packages ' '--break-system-packages '
if wants_break_system_packages if wants_break_system_packages