theforeman / pulpcore-packaging

1 stars 24 forks source link

Package conflicts when installing client bindings #363

Open maartenbeeckmans opened 2 years ago

maartenbeeckmans commented 2 years ago

When I'm installing client bindings for some custom scripting with packages from the rpm repository, there are package conflics as multiple files are owned by the same repository.

python3-pulpcore-client and python3-pulpcore have conflicts on the same file The same is happening for python3-pulpcore-client and python3-pulp-rpm-client

Already tried the option --best but that isn't helping.

Using a mirror (updated to upstream) of the pulpcore 3.14 repository Vm is running EL8

[root@pulp.example.com ~]# dnf install python3-pulp-rpm-client python3-pulpcore-client
Centos Appstream                                                                                                                                             53 MB/s | 8.0 MB     00:00
Centos BaseOS                                                                                                                                                21 MB/s | 2.7 MB     00:00
Centos Powertools                                                                                                                                            18 MB/s | 2.5 MB     00:00
Pulpcore 3.14                                                                                                                                               515 kB/s | 242 kB     00:00
Upstream                                                                                                                                                    3.5 MB/s | 395 kB     00:00
Dependencies resolved.
============================================================================================================================================================================================
 Package                                                 Architecture                           Version                                      Repository                                Size
============================================================================================================================================================================================
Installing:
 python3-pulp-rpm-client                                 noarch                                 3.13.3-1.el8                                 pulpcore                                 181 k
 python3-pulpcore-client                                 noarch                                 3.14.1-1.el8                                 pulpcore                                 173 k

Transaction Summary
============================================================================================================================================================================================
Install  2 Packages

Total download size: 353 k
Installed size: 3.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): python3-pulp-rpm-client-3.13.3-1.el8.noarch.rpm                                                                                                      1.0 MB/s | 181 kB     00:00
(2/2): python3-pulpcore-client-3.14.1-1.el8.noarch.rpm                                                                                                      1.0 MB/s | 173 kB     00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                       2.0 MB/s | 353 kB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /usr/lib/python3.6/site-packages/pulpcore/__init__.py from install of python3-pulpcore-client-3.14.1-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-pulpcore-client-3.14.1-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.pyc from install of python3-pulpcore-client-3.14.1-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__init__.py from install of python3-pulp-rpm-client-3.13.3-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-pulp-rpm-client-3.13.3-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.pyc from install of python3-pulp-rpm-client-3.13.3-1.el8.noarch conflicts with file from package python3-pulpcore-3.14.9-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.opt-1.pyc conflicts between attempted installs of python3-pulp-rpm-client-3.13.3-1.el8.noarch and python3-pulpcore-client-3.14.1-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/__pycache__/__init__.cpython-36.pyc conflicts between attempted installs of python3-pulp-rpm-client-3.13.3-1.el8.noarch and python3-pulpcore-client-3.14.1-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/client/__pycache__/__init__.cpython-36.opt-1.pyc conflicts between attempted installs of python3-pulp-rpm-client-3.13.3-1.el8.noarch and python3-pulpcore-client-3.14.1-1.el8.noarch
  file /usr/lib/python3.6/site-packages/pulpcore/client/__pycache__/__init__.cpython-36.pyc conflicts between attempted installs of python3-pulp-rpm-client-3.13.3-1.el8.noarch and python3-pulpcore-client-3.14.1-1.el8.noarch
ekohl commented 2 years ago

I wonder if this is also a problem in upstream. It's odd to me that they chose the pulpcore.client namespace. It implies the client tools need pulpcore to be installed too, but that's not logical.

maartenbeeckmans commented 2 years ago

Did some further investigation in a python container:

1) when I only install pulpcore-client with pip it creates the following files:

root@88697ba93215:/usr/local/lib/python3.10/site-packages/pulpcore# pwd
/usr/local/lib/python3.10/site-packages/pulpcore
root@88697ba93215:/usr/local/lib/python3.10/site-packages/pulpcore# ls
__init__.py  __pycache__  client

root@88697ba93215:/usr/local/lib/python3.10/site-packages/pulpcore/client# pwd
/usr/local/lib/python3.10/site-packages/pulpcore/client
root@88697ba93215:/usr/local/lib/python3.10/site-packages/pulpcore/client# ls
__init__.py  __pycache__  pulpcore

Client bindings are under the pulpcore folder

2) when I only install pulp-rpm-client with pip it creates the following files

root@e84e84946736:/usr/local/lib/python3.10/site-packages/pulpcore# pwd
/usr/local/lib/python3.10/site-packages/pulpcore
root@e84e84946736:/usr/local/lib/python3.10/site-packages/pulpcore# ls
__init__.py  __pycache__  client

root@e84e84946736:/usr/local/lib/python3.10/site-packages/pulpcore/client# pwd
/usr/local/lib/python3.10/site-packages/pulpcore/client
root@e84e84946736:/usr/local/lib/python3.10/site-packages/pulpcore/client# ls
__init__.py  __pycache__  pulp_rpm

Client bindings are under the pulp_rpm folder

3) when I install both pulpcore-client and pulp-rpm-client with pip it creates the following files

root@0150e93eb1dd:/usr/local/lib/python3.10/site-packages/pulpcore# pwd
/usr/local/lib/python3.10/site-packages/pulpcore
root@0150e93eb1dd:/usr/local/lib/python3.10/site-packages/pulpcore# ls
__init__.py  __pycache__  client

root@0150e93eb1dd:/usr/local/lib/python3.10/site-packages/pulpcore/client# pwd
/usr/local/lib/python3.10/site-packages/pulpcore/client
root@0150e93eb1dd:/usr/local/lib/python3.10/site-packages/pulpcore/client# ls
__init__.py  __pycache__  pulp_rpm  pulpcore

Client bindings are installed under the pulp_rpm and pulpcore folders

For testing I was using the python:bullseye container with python 3.10 installed, but that shouldn't really matter

So when installing it with pip, some files like the __init__.py and __pycache__ folder and subfiles are managed by both pip packages. Pip doesn't really care about it but yum/dnf/rpm does.

No idea how we should proceed with this.

Looks indeed that they are installed in the same namespace.

ekohl commented 2 years ago

I think this should be taken up with upstream. I know Python has a mechanism with .pth files but I've never used it and don't know if it's really a solution.