From 4a203f22c223c0ad2c22c1e119f5cd8e475bb1cb Mon Sep 17 00:00:00 2001 From: Devrin Talen Date: Fri, 13 Sep 2024 15:36:31 -0400 Subject: [PATCH] dev-python/system_hotkey: disable py3.8, py3.9 - Fixed broken test - Added virtualx eclass to test with a valid display - Added patch to fix Python compatibility issue - Added missing dependencies to RDEPEND - Added missing PYTHON_USEDEP to RDEPEND Signed-off-by: Devrin Talen --- ...otkey-1.0.3-fix-collections-iterable.patch | 15 +++++++++++++++ .../system_hotkey/system_hotkey-1.0.3.ebuild | 19 +++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 dev-python/system_hotkey/files/system_hotkey-1.0.3-fix-collections-iterable.patch diff --git a/dev-python/system_hotkey/files/system_hotkey-1.0.3-fix-collections-iterable.patch b/dev-python/system_hotkey/files/system_hotkey-1.0.3-fix-collections-iterable.patch new file mode 100644 index 0000000000..265c32a5f0 --- /dev/null +++ b/dev-python/system_hotkey/files/system_hotkey-1.0.3-fix-collections-iterable.patch @@ -0,0 +1,15 @@ +system_hotkey was written for a previous version of Python that had +collections.Iterable available. That moved under collections.abc in a +later release. + +--- a/system_hotkey/system_hotkey.py ++++ b/system_hotkey/system_hotkey.py +@@ -281,7 +281,7 @@ class MixIn(): + + thread safe + ''' +- assert isinstance(hotkey, collections.Iterable) and type(hotkey) not in (str, bytes) ++ assert isinstance(hotkey, collections.abc.Iterable) and type(hotkey) not in (str, bytes) + if self.consumer == 'callback' and not callback: + raise TypeError('Function register requires callback argument in non sonsumer mode') + diff --git a/dev-python/system_hotkey/system_hotkey-1.0.3.ebuild b/dev-python/system_hotkey/system_hotkey-1.0.3.ebuild index 1050af632b..cfe6a57714 100644 --- a/dev-python/system_hotkey/system_hotkey-1.0.3.ebuild +++ b/dev-python/system_hotkey/system_hotkey-1.0.3.ebuild @@ -4,8 +4,8 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..13} ) -inherit distutils-r1 +PYTHON_COMPAT=( python3_{10..13} ) +inherit distutils-r1 virtualx DESCRIPTION="Multi-platform system-wide hotkeys" HOMEPAGE="https://github.com/timeyyy/system_hotkey" @@ -17,6 +17,17 @@ SLOT="0" KEYWORDS="~amd64" # TODO this depends on xpybutil -RDEPEND=">=dev-python/xcffib-1.5.0" +RDEPEND=">=dev-python/xcffib-1.5.0[${PYTHON_USEDEP}] + >=dev-python/xpybutil-0.0.6[${PYTHON_USEDEP}] + >=dev-python/pytest-xvfb-3.0.0[${PYTHON_USEDEP}]" -distutils_enable_tests unittest +PATCHES=( + # Fix for unit test + "${FILESDIR}/${P}-fix-collections-iterable.patch" +) + +distutils_enable_tests pytest + +src_test() { + virtx distutils-r1_src_test +}