python-bindings icon indicating copy to clipboard operation
python-bindings copied to clipboard

Future of Docker releases of python bindings

Open fsimonis opened this issue 1 year ago • 0 comments

This issue also affects downstream python components.

Problem

With the publication of PEP 668, the pip uses changed.

In short, directly using pip:

  • conflicts with the system package manager and can lead to a broken system. A user should use the system package manager to install system-wide packages (apt, pacman, dnf, ..)
  • installing with --user interferes with the global python state of a user and can lead to a broken user account.

Proposed solution by the PEP:

  • Mark the global system as "externally managed" and block installation for root and --user.
  • Direct users to use a venv instead.

Implications on docker releases

To install the preCICE python bindings into an Ubuntu-based docker image one should use Debian packages.

The only pragmatic solution I can think of to make this work with Docker is to use a venv to install the preCICE bindings and then load it on login via /etc/profile.d/. Problem is that this only works if a user starts a login shell, which isn't the default of docker.

The real solution is probably to drop the Docker releases of python-related packages. Then always install and install python, and further adapter dependencies in a venv in the CI of whatever needs the bindings.

fsimonis avatar Feb 14 '24 13:02 fsimonis