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 +}