From 8bdd53a2d42010f0ec8f83273938a62195bfbcd5 Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan Date: Mon, 25 Jan 2021 22:31:30 +0100 Subject: dev-python/QtPy: allow dependency to be satisfied by pyside2 Now that pyside2 is in the repo, the test phase finally works! Bug: https://bugs.gentoo.org/767199 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Andrew Ammerlaan Signed-off-by: Joonas Niilola --- dev-python/QtPy/QtPy-1.9.0-r3.ebuild | 107 +++++++++++++++++++++++++++++++++++ dev-python/QtPy/metadata.xml | 73 +++++++++++++++--------- 2 files changed, 154 insertions(+), 26 deletions(-) create mode 100644 dev-python/QtPy/QtPy-1.9.0-r3.ebuild (limited to 'dev-python/QtPy') diff --git a/dev-python/QtPy/QtPy-1.9.0-r3.ebuild b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild new file mode 100644 index 000000000000..e707c30eebb6 --- /dev/null +++ b/dev-python/QtPy/QtPy-1.9.0-r3.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..8} ) + +inherit distutils-r1 virtualx + +DESCRIPTION="Abstraction layer on top of PyQt5 and PySide2 and additional custom QWidgets" +HOMEPAGE="https://github.com/spyder-ide/qtpy" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" + +IUSE=" + declarative designer gui help location multimedia network + opengl positioning printsupport qml quick sensors serialport + sql svg test testlib webchannel webengine websockets + widgets x11extras xml xmlpatterns +" + +# Webengine is a special case, because PyQt5 provides this in a +# separate package , while PySide2 ships it in the same package +# +# declarative/qml/quick is a special case, because PyQt5 bundles +# the bindings for qml and quick in one flag: declarative, +# PySide2 does not. +# +# The PyQt5 ebuild currently enables xml support unconditionally, +# the flag is added anyway with a (+) to make it future proof +# if the ebuild were to change this behaviour in the future. +# +# The PySide2 ebuild currently enables opengl and serialport +# support unconditionally, the flag is added anyway with a (+) +# to make it future proof if the ebuild were to change this +# behaviour in the future. +# +RDEPEND=" + app-eselect/eselect-QtPy + || ( + dev-python/PyQt5[${PYTHON_USEDEP},designer?,gui?,help?,location?,multimedia?,network?,opengl?,positioning?,printsupport?,sensors?,serialport?,sql?,svg?,testlib?,webchannel?,websockets?,widgets?,x11extras?,xml(+)?,xmlpatterns?] + dev-python/pyside2[${PYTHON_USEDEP},designer?,gui?,help?,location?,multimedia?,network?,opengl(+)?,positioning?,printsupport?,sensors?,serialport(+)?,sql?,svg?,testlib?,webchannel?,websockets?,widgets?,x11extras?,xml?,xmlpatterns?] + ) + + webengine? ( || ( + dev-python/PyQtWebEngine[${PYTHON_USEDEP}] + dev-python/pyside2[${PYTHON_USEDEP},webengine] + ) ) + + qml? ( || ( + dev-python/PyQt5[${PYTHON_USEDEP},declarative] + dev-python/pyside2[${PYTHON_USEDEP},qml] + ) ) + + quick? ( || ( + dev-python/PyQt5[${PYTHON_USEDEP},declarative] + dev-python/pyside2[${PYTHON_USEDEP},quick] + ) ) + + declarative? ( || ( + dev-python/PyQt5[${PYTHON_USEDEP},declarative] + dev-python/pyside2[${PYTHON_USEDEP},qml,quick] + ) ) +" + +# These bindings are currently only provided by PyQt5 or PySide2 +# but not by both. Just DEPEND on these directly if they are +# required. +# Please check periodically if this list is still up to date +# +# bluetooth? ( dev-python/PyQt5[${PYTHON_USEDEP},bluetooth] ) +# dbus? ( dev-python/PyQt5[${PYTHON_USEDEP},dbus] ) +# examples? ( dev-python/PyQt5[${PYTHON_USEDEP},examples] ) +# networkauth? ( dev-python/PyQt5[${PYTHON_USEDEP},networkauth] ) +# ssl? ( dev-python/PyQt5[${PYTHON_USEDEP},ssl] ) +# webkit? ( dev-python/PyQt5[${PYTHON_USEDEP},webkit] ) +# +# 3d? ( dev-python/pyside2[${PYTHON_USEDEP},3d] ) +# charts? ( dev-python/pyside2[${PYTHON_USEDEP},charts] ) +# concurrent? ( dev-python/pyside2[${PYTHON_USEDEP},concurrent] ) +# datavis? ( dev-python/pyside2[${PYTHON_USEDEP},datavis] ) +# scxml? ( dev-python/pyside2[${PYTHON_USEDEP},scxml] ) +# script? ( dev-python/pyside2[${PYTHON_USEDEP},script] ) +# scripttools? ( dev-python/pyside2[${PYTHON_USEDEP},scripttools] ) +# speech? ( dev-python/pyside2[${PYTHON_USEDEP},speech] ) + +# The QtPy testsuite skips tests for bindings that are +# not installed, so here we ensure that everything +# is available and all tests are run. +BDEPEND="test? ( + 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/PyQtWebEngine[${PYTHON_USEDEP}] + dev-python/pyside2[${PYTHON_USEDEP},3d,charts,concurrent,datavis,designer,gui,help,location,multimedia,network,opengl(+),positioning,printsupport,qml,quick,script,scripttools,scxml,sensors,serialport(+),speech,sql,svg,testlib,webchannel,webengine,websockets,widgets,x11extras,xml,xmlpatterns] +)" + +distutils_enable_tests pytest + +python_test() { + export QT_API="pyqt5" + virtx pytest -vv + export QT_API="pyside2" + virtx pytest -vv + unset QT_API +} diff --git a/dev-python/QtPy/metadata.xml b/dev-python/QtPy/metadata.xml index a19bcec18947..5b164c14610b 100644 --- a/dev-python/QtPy/metadata.xml +++ b/dev-python/QtPy/metadata.xml @@ -1,30 +1,51 @@ - - python@gentoo.org - Gentoo Python Project - - - QtPy is a small abstraction layer that lets you write - applications using a single API call to either PyQt or - PySide. QtPy also provides a set of additional QWidgets. It - provides support for PyQt5, PyQt4 and PySide using the PyQt5 - layout (where the QtGui module has been split into QtGui and - QtWidgets). - Basically, you write your code as if you were using PyQt5 but - import qt from QtPy instead of PyQt5. - - - Build bindings for the QtDesigner module and enable the designer plugin - Build bindings for the QtGui module - Build bindings for the QtPrintSupport module - Build bindings for the QtSvg module - Build bindings for the QtTest module - Build bindings for the QtWebEngine module - - - spyder-ide/qtpy - QtPy - + + python@gentoo.org + Gentoo Python Project + + + andrewammerlaan@riseup.net + Andrew Ammerlaan + + + proxy-maint@gentoo.org + Proxy Maintainers + + + QtPy is a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. + It provides support for PyQt5, PyQt4, PySide2 and PySide using the Qt5 layout (where the QtGui module has been split into QtGui and QtWidgets). + Basically, you can write your code as if you were using PySide2 but import Qt modules from qtpy instead of PySide2 (or PyQt5) + + + Pull in bindings for the QtQml/QtQuick modules and enable the qmlscene plugin + Pull in bindings for the QtDesigner module and enable the designer plugin + Pull in bindings for the QtGui module + Pull in bindings for the QtHelp module + Pull in bindings for the QtLocation module + Pull in QtMultimedia and QtMultimediaWidgets modules + Pull in bindings for the QtNetwork module + Pull in bindings for the QtOpenGL module + Pull in bindings for the QtPositioning module + Pull in bindings for the QtPrintSupport module + Pull in QtQml module + Pull in QtQuick and QtQuickWidgets modules + Pull in bindings for the QtSensors module + Pull in bindings for the QtSerialPort module + Pull in bindings for the QtSql module + Pull in bindings for the QtSvg module + Pull in bindings for the QtTest module + Pull in bindings for the QtWebChannel module + Pull in QtWebEngine and QtWebEngineWidgets modules + Pull in bindings for the QtWebSockets module + Pull in bindings for the QtWidgets module + Pull in bindings for the QtX11Extras module + Pull in bindings for the QtXmlPatterns module + Pull in QtXml module + + + spyder-ide/qtpy + QtPy + -- cgit v1.2.3