Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/QtPy/files/, dev-python/QtPy/
Date: Tue, 01 Jun 2021 17:07:29
Message-Id: 1622567228.83cdaf684ee505b580cbcb7da7b7ef29fcc98674.andrewammerlaan@gentoo
1 commit: 83cdaf684ee505b580cbcb7da7b7ef29fcc98674
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 29 08:36:55 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 1 17:07:08 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83cdaf68
7
8 dev-python/QtPy: drop netwrokauth and webkit flag, add py3.{9,10}
9
10 - PySide2 is not compatible with python3.10, to add python3.10
11 to this package anyway we need to force disable pyside2 if
12 we want to use python_targets_python3_10.
13
14 - To accomadate this we have to rewrite the test suite to
15 support running if one of the two implementations is
16 disabled. Otherwise tests would fail with USE="pyqt5 -pyside2
17 python_targets_python3_10: due to ImportErrors that we
18 explicitly introduced in the prepare phase with USE="-pyside2"
19
20 Closes: https://bugs.gentoo.org/780330
21 Package-Manager: Portage-3.0.19, Repoman-3.0.3
22 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
23
24 .../{QtPy-1.9.0-r2.ebuild => QtPy-1.9.0-r3.ebuild} | 7 ++-
25 .../{QtPy-1.9.0-r4.ebuild => QtPy-1.9.0-r5.ebuild} | 73 ++++++++++++++--------
26 dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch | 13 ++++
27 3 files changed, 65 insertions(+), 28 deletions(-)
28
29 diff --git a/dev-python/QtPy/QtPy-1.9.0-r2.ebuild b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild
30 similarity index 79%
31 rename from dev-python/QtPy/QtPy-1.9.0-r2.ebuild
32 rename to dev-python/QtPy/QtPy-1.9.0-r3.ebuild
33 index 8e1f50a8e47..7ee5dea86d8 100644
34 --- a/dev-python/QtPy/QtPy-1.9.0-r2.ebuild
35 +++ b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild
36 @@ -30,7 +30,11 @@ RDEPEND="
37 BDEPEND="
38 test? (
39 dev-python/mock[${PYTHON_USEDEP}]
40 - 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]
41 + dev-python/PyQt5[${PYTHON_USEDEP}]
42 + dev-python/PyQt5[bluetooth,dbus,declarative,designer,gui,help,location]
43 + dev-python/PyQt5[multimedia,network,opengl,positioning,printsupport]
44 + dev-python/PyQt5[sensors,serialport,sql,svg,testlib,webchannel]
45 + dev-python/PyQt5[websockets,widgets,x11extras,xml(+),xmlpatterns]
46 dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
47 )"
48
49 @@ -40,6 +44,7 @@ src_prepare() {
50 default
51
52 sed -i -e "s/from PyQt4.Qt import/raise ImportError #/" qtpy/__init__.py || die
53 + sed -i -e "s/from PyQt4.QtCore import/raise ImportError #/" qtpy/__init__.py || die
54 sed -i -e "s/from PySide import/raise ImportError #/" qtpy/__init__.py || die
55 sed -i -e "s/from PySide2 import/raise ImportError #/" qtpy/__init__.py || die
56 }
57
58 diff --git a/dev-python/QtPy/QtPy-1.9.0-r4.ebuild b/dev-python/QtPy/QtPy-1.9.0-r5.ebuild
59 similarity index 66%
60 rename from dev-python/QtPy/QtPy-1.9.0-r4.ebuild
61 rename to dev-python/QtPy/QtPy-1.9.0-r5.ebuild
62 index 0aa58b9aaab..b2d2c09acca 100644
63 --- a/dev-python/QtPy/QtPy-1.9.0-r4.ebuild
64 +++ b/dev-python/QtPy/QtPy-1.9.0-r5.ebuild
65 @@ -3,7 +3,7 @@
66
67 EAPI=7
68
69 -PYTHON_COMPAT=( python3_{7..8} )
70 +PYTHON_COMPAT=( python3_{7..10} )
71
72 inherit distutils-r1 virtualx
73
74 @@ -23,17 +23,19 @@ _IUSE_QT_MODULES="
75 IUSE="+pyqt5 pyside2 ${_IUSE_QT_MODULES}"
76 unset _IUSE_QT_MODULES
77
78 +# PySide2 does not support python3_10, nor is it likely that it will in the
79 +# future since upstream appears to be focussing on PySide6 for Qt6 instead
80 +# (which is compatible with python3_10). So if we want to use python3_10
81 +# we have to force disable pyside2.
82 REQUIRED_USE="
83 || ( pyqt5 pyside2 )
84 - test? ( pyqt5 pyside2 )
85 + python_targets_python3_10? ( pyqt5 !pyside2 )
86 "
87
88 # These flags are currently *not* common to both the PySide2 and PyQt5 ebuild
89 # Disable them for now, please check periodically if this is still up to date.
90 # bluetooth? ( pyqt5 )
91 # dbus? ( pyqt5 )
92 -# networkauth? ( pyqt5 )
93 -# webkit? ( pyqt5 )
94 #
95 # 3d? ( pyside2 )
96 # charts? ( pyside2 )
97 @@ -72,13 +74,15 @@ RDEPEND="
98 webengine? ( dev-python/PyQtWebEngine[${PYTHON_USEDEP}] )
99 )
100 pyside2? (
101 - dev-python/pyside2[${PYTHON_USEDEP}]
102 - dev-python/pyside2[designer?,gui?,help?,location?,multimedia?]
103 - dev-python/pyside2[network?,opengl(+)?,positioning?,printsupport?]
104 - dev-python/pyside2[sensors?,serialport(+)?,sql?,svg?,testlib?]
105 - dev-python/pyside2[webchannel?,webengine?,websockets?,widgets?]
106 - dev-python/pyside2[x11extras?,xml?,xmlpatterns?]
107 - declarative? ( dev-python/pyside2[qml,quick] )
108 + $(python_gen_cond_dep '
109 + dev-python/pyside2[${PYTHON_USEDEP}]
110 + dev-python/pyside2[designer?,gui?,help?,location?,multimedia?]
111 + dev-python/pyside2[network?,opengl(+)?,positioning?,printsupport?]
112 + dev-python/pyside2[sensors?,serialport(+)?,sql?,svg?,testlib?]
113 + dev-python/pyside2[webchannel?,webengine?,websockets?,widgets?]
114 + dev-python/pyside2[x11extras?,xml?,xmlpatterns?]
115 + declarative? ( dev-python/pyside2[qml,quick] )
116 + ' python3_{7..9} )
117 )
118 "
119
120 @@ -90,22 +94,29 @@ BDEPEND="
121 dev-python/mock[${PYTHON_USEDEP}]
122 dev-python/PyQt5[${PYTHON_USEDEP}]
123 dev-python/PyQt5[bluetooth,dbus,declarative,designer,gui,help,location]
124 - dev-python/PyQt5[multimedia,network,networkauth,opengl,positioning]
125 - dev-python/PyQt5[printsupport,sensors,serialport,sql,svg,testlib]
126 - dev-python/PyQt5[webchannel,websockets,widgets,x11extras,xml(+)]
127 - dev-python/PyQt5[xmlpatterns]
128 + dev-python/PyQt5[multimedia,network,opengl,positioning,printsupport]
129 + dev-python/PyQt5[sensors,serialport,sql,svg,testlib,webchannel]
130 + dev-python/PyQt5[websockets,widgets,x11extras,xml(+),xmlpatterns]
131 dev-python/PyQtWebEngine[${PYTHON_USEDEP}]
132 - dev-python/pyside2[${PYTHON_USEDEP}]
133 - dev-python/pyside2[3d,charts,concurrent,datavis,designer,gui,help]
134 - dev-python/pyside2[location,multimedia,network,opengl(+),positioning]
135 - dev-python/pyside2[printsupport,qml,quick,script,scripttools,scxml]
136 - dev-python/pyside2[sensors,serialport(+),speech,sql,svg,testlib]
137 - dev-python/pyside2[webchannel,webengine,websockets,widgets,x11extras]
138 - dev-python/pyside2[xml,xmlpatterns]
139 -)"
140 + $(python_gen_cond_dep '
141 + dev-python/pyside2[${PYTHON_USEDEP}]
142 + dev-python/pyside2[3d,charts,concurrent,datavis,designer,gui,help]
143 + dev-python/pyside2[location,multimedia,network,opengl(+),positioning]
144 + dev-python/pyside2[printsupport,qml,quick,script,scripttools,scxml]
145 + dev-python/pyside2[sensors,serialport(+),speech,sql,svg,testlib]
146 + dev-python/pyside2[webchannel,webengine,websockets,widgets,x11extras]
147 + dev-python/pyside2[xml,xmlpatterns]
148 + ' python3_{7..9} )
149 + )
150 +"
151
152 distutils_enable_tests pytest
153
154 +# https://github.com/spyder-ide/qtpy/issues/238
155 +PATCHES=(
156 + "${FILESDIR}/${P}-python3_9.patch"
157 +)
158 +
159 src_prepare() {
160 default
161 if ! use pyqt5; then
162 @@ -113,12 +124,14 @@ src_prepare() {
163 fi
164 if ! use pyside2; then
165 sed -i -e "s/from PySide2 import/raise ImportError #/" qtpy/__init__.py || die
166 + sed -i -e "s/from PySide2.QtCore import/raise ImportError #/" qtpy/__init__.py || die
167 fi
168
169 # Disable outdated PyQt4 and PySide
170 sed -i -e "s/from PyQt4.Qt import/raise ImportError #/" qtpy/__init__.py || die
171 sed -i -e "s/from PyQt4.QtCore import/raise ImportError #/" qtpy/__init__.py || die
172 sed -i -e "s/from PySide import/raise ImportError #/" qtpy/__init__.py || die
173 + sed -i -e "s/from PySide.QtCore import/raise ImportError #/" qtpy/__init__.py || die
174 }
175
176 src_test() {
177 @@ -126,10 +139,16 @@ src_test() {
178 }
179
180 python_test() {
181 - local -x QT_API
182 - for QT_API in pyqt5 pyside2; do
183 - epytest
184 - done
185 + if use pyqt5; then
186 + QT_API="pyqt5" epytest
187 + fi
188 + if use pyside2; then
189 + if [[ "${EPYTHON}" == "python3.10" ]]; then
190 + return
191 + else
192 + QT_API="pyside2" epytest
193 + fi
194 + fi
195 }
196
197 pkg_postinst() {
198
199 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
200 new file mode 100644
201 index 00000000000..7a3d812f177
202 --- /dev/null
203 +++ b/dev-python/QtPy/files/QtPy-1.9.0-python3_9.patch
204 @@ -0,0 +1,13 @@
205 +diff --git a/qtpy/uic.py b/qtpy/uic.py
206 +index 07d7a78..84525ab 100644
207 +--- a/qtpy/uic.py
208 ++++ b/qtpy/uic.py
209 +@@ -181,7 +181,7 @@ else:
210 +
211 + custom_widget_classes = {}
212 +
213 +- for custom_widget in custom_widgets.getchildren():
214 ++ for custom_widget in list(custom_widgets):
215 +
216 + cw_class = custom_widget.find('class').text
217 + cw_header = custom_widget.find('header').text