summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2021-05-29 10:36:55 +0200
committerAndrew Ammerlaan <andrewammerlaan@gentoo.org>2021-06-01 19:07:08 +0200
commit83cdaf684ee505b580cbcb7da7b7ef29fcc98674 (patch)
tree0034580c1a924d1b75b4663f5b1d5945658b432b
parentdev-python/PyQtWebEngine: add 5.15.4, add py3.10 (diff)
downloadgentoo-83cdaf684ee505b580cbcb7da7b7ef29fcc98674.tar.gz
gentoo-83cdaf684ee505b580cbcb7da7b7ef29fcc98674.tar.bz2
gentoo-83cdaf684ee505b580cbcb7da7b7ef29fcc98674.zip
dev-python/QtPy: drop netwrokauth and webkit flag, add py3.{9,10}
- PySide2 is not compatible with python3.10, to add python3.10 to this package anyway we need to force disable pyside2 if we want to use python_targets_python3_10. - To accomadate this we have to rewrite the test suite to support running if one of the two implementations is disabled. Otherwise tests would fail with USE="pyqt5 -pyside2 python_targets_python3_10: due to ImportErrors that we explicitly introduced in the prepare phase with USE="-pyside2" Closes: https://bugs.gentoo.org/780330 Package-Manager: Portage-3.0.19, Repoman-3.0.3 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
-rw-r--r--dev-python/QtPy/QtPy-1.9.0-r3.ebuild (renamed from dev-python/QtPy/QtPy-1.9.0-r2.ebuild)7
-rw-r--r--dev-python/QtPy/QtPy-1.9.0-r5.ebuild (renamed from dev-python/QtPy/QtPy-1.9.0-r4.ebuild)73
-rw-r--r--dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch13
3 files changed, 65 insertions, 28 deletions
diff --git a/dev-python/QtPy/QtPy-1.9.0-r2.ebuild b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild
index 8e1f50a8e472..7ee5dea86d8e 100644
--- a/dev-python/QtPy/QtPy-1.9.0-r2.ebuild
+++ b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild
@@ -30,7 +30,11 @@ RDEPEND="
BDEPEND="
test? (
dev-python/mock[${PYTHON_USEDEP}]
- dev-python/PyQt5[${PYTHON_USEDEP},bluetooth,dbus,declarative,designer,gui,help,location,multimedia,network,networkauth,opengl,positioning,printsupport,sensors,serialport,sql,ssl,svg,testlib,webchannel,webkit,websockets,widgets,x11extras,xml(+),xmlpatterns]
+ dev-python/PyQt5[${PYTHON_USEDEP}]
+ dev-python/PyQt5[bluetooth,dbus,declarative,designer,gui,help,location]
+ dev-python/PyQt5[multimedia,network,opengl,positioning,printsupport]
+ dev-python/PyQt5[sensors,serialport,sql,svg,testlib,webchannel]
+ dev-python/PyQt5[websockets,widgets,x11extras,xml(+),xmlpatterns]
dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
)"
@@ -40,6 +44,7 @@ src_prepare() {
default
sed -i -e "s/from PyQt4.Qt import/raise ImportError #/" qtpy/__init__.py || die
+ sed -i -e "s/from PyQt4.QtCore import/raise ImportError #/" qtpy/__init__.py || die
sed -i -e "s/from PySide import/raise ImportError #/" qtpy/__init__.py || die
sed -i -e "s/from PySide2 import/raise ImportError #/" qtpy/__init__.py || die
}
diff --git a/dev-python/QtPy/QtPy-1.9.0-r4.ebuild b/dev-python/QtPy/QtPy-1.9.0-r5.ebuild
index 0aa58b9aaab0..b2d2c09acca2 100644
--- a/dev-python/QtPy/QtPy-1.9.0-r4.ebuild
+++ b/dev-python/QtPy/QtPy-1.9.0-r5.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..8} )
+PYTHON_COMPAT=( python3_{7..10} )
inherit distutils-r1 virtualx
@@ -23,17 +23,19 @@ _IUSE_QT_MODULES="
IUSE="+pyqt5 pyside2 ${_IUSE_QT_MODULES}"
unset _IUSE_QT_MODULES
+# PySide2 does not support python3_10, nor is it likely that it will in the
+# future since upstream appears to be focussing on PySide6 for Qt6 instead
+# (which is compatible with python3_10). So if we want to use python3_10
+# we have to force disable pyside2.
REQUIRED_USE="
|| ( pyqt5 pyside2 )
- test? ( pyqt5 pyside2 )
+ python_targets_python3_10? ( pyqt5 !pyside2 )
"
# These flags are currently *not* common to both the PySide2 and PyQt5 ebuild
# Disable them for now, please check periodically if this is still up to date.
# bluetooth? ( pyqt5 )
# dbus? ( pyqt5 )
-# networkauth? ( pyqt5 )
-# webkit? ( pyqt5 )
#
# 3d? ( pyside2 )
# charts? ( pyside2 )
@@ -72,13 +74,15 @@ RDEPEND="
webengine? ( dev-python/PyQtWebEngine[${PYTHON_USEDEP}] )
)
pyside2? (
- dev-python/pyside2[${PYTHON_USEDEP}]
- dev-python/pyside2[designer?,gui?,help?,location?,multimedia?]
- dev-python/pyside2[network?,opengl(+)?,positioning?,printsupport?]
- dev-python/pyside2[sensors?,serialport(+)?,sql?,svg?,testlib?]
- dev-python/pyside2[webchannel?,webengine?,websockets?,widgets?]
- dev-python/pyside2[x11extras?,xml?,xmlpatterns?]
- declarative? ( dev-python/pyside2[qml,quick] )
+ $(python_gen_cond_dep '
+ dev-python/pyside2[${PYTHON_USEDEP}]
+ dev-python/pyside2[designer?,gui?,help?,location?,multimedia?]
+ dev-python/pyside2[network?,opengl(+)?,positioning?,printsupport?]
+ dev-python/pyside2[sensors?,serialport(+)?,sql?,svg?,testlib?]
+ dev-python/pyside2[webchannel?,webengine?,websockets?,widgets?]
+ dev-python/pyside2[x11extras?,xml?,xmlpatterns?]
+ declarative? ( dev-python/pyside2[qml,quick] )
+ ' python3_{7..9} )
)
"
@@ -90,22 +94,29 @@ BDEPEND="
dev-python/mock[${PYTHON_USEDEP}]
dev-python/PyQt5[${PYTHON_USEDEP}]
dev-python/PyQt5[bluetooth,dbus,declarative,designer,gui,help,location]
- dev-python/PyQt5[multimedia,network,networkauth,opengl,positioning]
- dev-python/PyQt5[printsupport,sensors,serialport,sql,svg,testlib]
- dev-python/PyQt5[webchannel,websockets,widgets,x11extras,xml(+)]
- dev-python/PyQt5[xmlpatterns]
+ dev-python/PyQt5[multimedia,network,opengl,positioning,printsupport]
+ dev-python/PyQt5[sensors,serialport,sql,svg,testlib,webchannel]
+ dev-python/PyQt5[websockets,widgets,x11extras,xml(+),xmlpatterns]
dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
- dev-python/pyside2[${PYTHON_USEDEP}]
- dev-python/pyside2[3d,charts,concurrent,datavis,designer,gui,help]
- dev-python/pyside2[location,multimedia,network,opengl(+),positioning]
- dev-python/pyside2[printsupport,qml,quick,script,scripttools,scxml]
- dev-python/pyside2[sensors,serialport(+),speech,sql,svg,testlib]
- dev-python/pyside2[webchannel,webengine,websockets,widgets,x11extras]
- dev-python/pyside2[xml,xmlpatterns]
-)"
+ $(python_gen_cond_dep '
+ dev-python/pyside2[${PYTHON_USEDEP}]
+ dev-python/pyside2[3d,charts,concurrent,datavis,designer,gui,help]
+ dev-python/pyside2[location,multimedia,network,opengl(+),positioning]
+ dev-python/pyside2[printsupport,qml,quick,script,scripttools,scxml]
+ dev-python/pyside2[sensors,serialport(+),speech,sql,svg,testlib]
+ dev-python/pyside2[webchannel,webengine,websockets,widgets,x11extras]
+ dev-python/pyside2[xml,xmlpatterns]
+ ' python3_{7..9} )
+ )
+"
distutils_enable_tests pytest
+# https://github.com/spyder-ide/qtpy/issues/238
+PATCHES=(
+ "${FILESDIR}/${P}-python3_9.patch"
+)
+
src_prepare() {
default
if ! use pyqt5; then
@@ -113,12 +124,14 @@ src_prepare() {
fi
if ! use pyside2; then
sed -i -e "s/from PySide2 import/raise ImportError #/" qtpy/__init__.py || die
+ sed -i -e "s/from PySide2.QtCore import/raise ImportError #/" qtpy/__init__.py || die
fi
# Disable outdated PyQt4 and PySide
sed -i -e "s/from PyQt4.Qt import/raise ImportError #/" qtpy/__init__.py || die
sed -i -e "s/from PyQt4.QtCore import/raise ImportError #/" qtpy/__init__.py || die
sed -i -e "s/from PySide import/raise ImportError #/" qtpy/__init__.py || die
+ sed -i -e "s/from PySide.QtCore import/raise ImportError #/" qtpy/__init__.py || die
}
src_test() {
@@ -126,10 +139,16 @@ src_test() {
}
python_test() {
- local -x QT_API
- for QT_API in pyqt5 pyside2; do
- epytest
- done
+ if use pyqt5; then
+ QT_API="pyqt5" epytest
+ fi
+ if use pyside2; then
+ if [[ "${EPYTHON}" == "python3.10" ]]; then
+ return
+ else
+ QT_API="pyside2" epytest
+ fi
+ fi
}
pkg_postinst() {
diff --git a/dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch b/dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch
new file mode 100644
index 000000000000..7a3d812f1771
--- /dev/null
+++ b/dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch
@@ -0,0 +1,13 @@
+diff --git a/qtpy/uic.py b/qtpy/uic.py
+index 07d7a78..84525ab 100644
+--- a/qtpy/uic.py
++++ b/qtpy/uic.py
+@@ -181,7 +181,7 @@ else:
+
+ custom_widget_classes = {}
+
+- for custom_widget in custom_widgets.getchildren():
++ for custom_widget in list(custom_widgets):
+
+ cw_class = custom_widget.find('class').text
+ cw_header = custom_widget.find('header').text