commit: ad20297abb44b98b63c188090db6dcdb9d49faa2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Tue Jun 9 07:08:47 2020 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Tue Jun 9 07:09:09 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad20297a
dev-python/pyperclip: Fix wrong checks for PyQt* Closes: https://bugs.gentoo.org/727588 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../files/pyperclip-1.7.0-test-pyqt.patch | 33 ++++++++++++++++++++++ dev-python/pyperclip/pyperclip-1.7.0.ebuild | 17 +++++++++++ 2 files changed, 50 insertions(+) diff --git a/dev-python/pyperclip/files/pyperclip-1.7.0-test-pyqt.patch b/dev-python/pyperclip/files/pyperclip-1.7.0-test-pyqt.patch new file mode 100644 index 00000000000..4f1a94955f4 --- /dev/null +++ b/dev-python/pyperclip/files/pyperclip-1.7.0-test-pyqt.patch @@ -0,0 +1,33 @@ +From be59ac638e26aff5204a32333f7ebe046003065a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]> +Date: Tue, 9 Jun 2020 08:46:46 +0200 +Subject: [PATCH] Make PyQt checks in tests more specific + +Test whether the widgets module can be imported rather than 'PyQt?' +in general. The latter gives false positives if PyQt is uninstalled +but there are leftover subpackages such as qscintilla. In this case, +Python 3 imports 'PyQt?' as a namespace. +--- + tests/test_pyperclip.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_pyperclip.py b/tests/test_pyperclip.py +index 7519d94..2942639 100644 +--- a/tests/test_pyperclip.py ++++ b/tests/test_pyperclip.py +@@ -146,10 +146,10 @@ class TestGtk(_TestClipboard): + class TestQt(_TestClipboard): + if HAS_DISPLAY: + try: +- import PyQt5 ++ import PyQt5.QtWidgets + except ImportError: + try: +- import PyQt4 ++ import PyQt4.QtGui + except ImportError: + pass + else: +-- +2.27.0 + diff --git a/dev-python/pyperclip/pyperclip-1.7.0.ebuild b/dev-python/pyperclip/pyperclip-1.7.0.ebuild index 8ae4348d65c..83e29c1235e 100644 --- a/dev-python/pyperclip/pyperclip-1.7.0.ebuild +++ b/dev-python/pyperclip/pyperclip-1.7.0.ebuild @@ -19,8 +19,25 @@ RDEPEND=" x11-misc/xclip x11-misc/xsel dev-python/PyQt5[${PYTHON_USEDEP}] + dev-python/QtPy[${PYTHON_USEDEP}] ) " +# test at least one backend +BDEPEND=" + test? ( + ${RDEPEND} + ) +" + +PATCHES=( + "${FILESDIR}"/${P}-test-pyqt.patch +) + +src_prepare() { + # stupid windows + find -type f -exec sed -i -e 's:\r$::' {} + || die + distutils-r1_src_prepare +} python_test() { "${EPYTHON}" tests/test_pyperclip.py -vv ||
