Skip to content

Commit

Permalink
setup.py: fix pyqt_sip_dir on modern Linux distributions
Browse files Browse the repository at this point in the history
QtCore/QtCoremod.sip may be installed to:
/usr/lib/python3.9/site-packages/PyQt5/bindings/QtCore/QtCoremod.sip
See also: https://github.com/qgis/QGIS/blob/master/cmake/FindPyQt5.py

Closes: https://bugs.gentoo.org/820473
Signed-off-by: Huang Rui <[email protected]>
  • Loading branch information
vowstar committed May 7, 2022
1 parent 9f4706a commit bdb22d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

cfg = sipconfig.Configuration()
pyqt_sip_dir = cfg.default_sip_dir
for p in (os.path.join(pyqt_sip_dir, "PyQt5"),
os.path.join(pyqt_sip_dir, "PyQt5-3"),
os.path.join(pyqt_sip_dir, "PyQt4"),
pyqt_sip_dir,
os.path.join(cfg.default_mod_dir, "PyQt5", "bindings")):
if os.path.exists(os.path.join(p, "QtCore", "QtCoremod.sip")):
pyqt_sip_dir = p
break

try:
import PyQt5
Expand Down

0 comments on commit bdb22d3

Please sign in to comment.