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 <devrin@fastmail.com>
This commit is contained in:
Devrin Talen
2024-09-13 15:36:31 -04:00
parent e123e951c0
commit 4a203f22c2
2 changed files with 30 additions and 4 deletions

View File

@@ -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')

View File

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