Bug 258563 - devel/py-qt5: missing egg-info, invisible to pip
Summary: devel/py-qt5: missing egg-info, invisible to pip
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (Team)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-09-17 22:03 UTC by Jakub Šebek
Modified: 2021-09-18 01:28 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Šebek 2021-09-17 22:03:56 UTC
Unlike other python packages, the py38-qt5 package (and possibly the whole devel/py-qt5 port) doesn't install egg-info or any other indication of its existence. This causes parts of the python toolchain (such as pip) to not recognize it as a python package, causing numerous issues.

The issue we to was that when installing a pip package dependent on PyQt5, pip insists that it compile and install PyQt5 because it cannot find it.

Steps to reproduce:
1) Install the package with `pkg install py38-qt5`
2) Install pip with `pkg install py38-pip`
3) Try to install software depending on the PyQt5 package or the package itself with `pip install PyQt5`

pip will now start installing build dependencies and try to build the package from source, instead of the expected output: "Requirement already satisfied: PyQt5 in /usr/local/lib/python3.8/site-packages (5.15.4)".

Note: The binding is still likely usable in python scripts because the metaport also installs QtPy, which DOES specify PyQt5 as the top-level directory in its egg-info. However, this clearly isn't sufficient.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-09-17 23:34:04 UTC
Using pip with/as root is an unsupported Python configuration as it can and does produce inconsistent site-packages environments, while we understand why people might use it. 

Is this issue also reproducible using pip in a virtualenv using --system-site-packages with py-qt5 installed (via pkg) ?
Comment 2 Jakub Šebek 2021-09-18 01:28:34 UTC
(In reply to Kubilay Kocak from comment #1)
Yes, it is. Here is what I did:

$ virtualenv --system-site-packages testenv
Using base prefix '/usr/local'
New python executable in /usr/home/jakubsebek/testenv/bin/python3.8
Also creating executable in /usr/home/jakubsebek/testenv/bin/python
Installing setuptools, pip, wheel...
done.
$ source testenv/bin/activate
(testenv) $ pip install pillow
Requirement already satisfied: pillow in /usr/local/lib/python3.8/site-packages (8.2.0)
(testenv) $ pip install PyQt5
Collecting PyQt5
  Using cached PyQt5-5.15.4.tar.gz (3.3 MB)
  Installing build dependencies ... -^canceled

You can see that pillow, which has been installed with `pkg install py38-pillow`, is found as expected. PyQt5, which has been installed with `pkg install py38-qt5`, isn't.