From dbebc0931cdc55b4d8dc1aab63b2632466a88657bfc5b6a84eb9f00450dafbf3 Mon Sep 17 00:00:00 2001 From: Matthias Bach Date: Wed, 29 Jan 2025 19:57:20 +0000 Subject: [PATCH] - Update to 1.8.0 * The evdev.ecodes module is now generated at install time and contains only constants. This allows type checking and introspection of the evdev.ecodes module, without having to execute it first. The old module is available as evdev.ecodes_runtime. * Reverse mappings in evdev.ecodes that point to more than one value are now tuples instead of lists. * Fix keyboard delay and repeat being swapped. * Move the syn() convenience method from InputDevice to EventIO. - Add fix-tests.patch to pull in test fixes that upstream only included after tagging their release. - Switch source download during packaging from disabledrun to manualrun. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-evdev?expand=0&rev=34 --- .gitattributes | 23 ++++++ .gitignore | 1 + _service | 3 + fix-tests.patch | 25 ++++++ python-evdev-1.7.1.tar.gz | 3 + python-evdev-1.8.0.tar.gz | 3 + python-evdev.changes | 158 ++++++++++++++++++++++++++++++++++++++ python-evdev.spec | 69 +++++++++++++++++ 8 files changed, 285 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 fix-tests.patch create mode 100644 python-evdev-1.7.1.tar.gz create mode 100644 python-evdev-1.8.0.tar.gz create mode 100644 python-evdev.changes create mode 100644 python-evdev.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..eb0b1ca --- /dev/null +++ b/_service @@ -0,0 +1,3 @@ + + + diff --git a/fix-tests.patch b/fix-tests.patch new file mode 100644 index 0000000..742d20e --- /dev/null +++ b/fix-tests.patch @@ -0,0 +1,25 @@ +From: Georgi Valkov +Date: Sat, 25 Jan 2025 18:04:39 +0100 +Subject: [PATCH] Fix tests +Upstream: merged + +This is pulled from upstream main branch where it was committed right after the release. + +--- + tests/test_util.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_util.py b/tests/test_util.py +index 5a979df..7112927 100644 +--- a/tests/test_util.py ++++ b/tests/test_util.py +@@ -6,7 +6,7 @@ def test_match_ecodes_a(): + assert res == {1: [372, 418, 419, 420]} + assert dict(util.resolve_ecodes_dict(res)) == { + ("EV_KEY", 1): [ +- (["KEY_FULL_SCREEN", "KEY_ZOOM"], 372), ++ (("KEY_FULL_SCREEN", "KEY_ZOOM"), 372), + ("KEY_ZOOMIN", 418), + ("KEY_ZOOMOUT", 419), + ("KEY_ZOOMRESET", 420), + diff --git a/python-evdev-1.7.1.tar.gz b/python-evdev-1.7.1.tar.gz new file mode 100644 index 0000000..9b45ed1 --- /dev/null +++ b/python-evdev-1.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f09ccbb89880dd82c7f71482b662fb1ebb5824968cac0cd3d4e50b9f7715f6a +size 88275 diff --git a/python-evdev-1.8.0.tar.gz b/python-evdev-1.8.0.tar.gz new file mode 100644 index 0000000..1407bcf --- /dev/null +++ b/python-evdev-1.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:886a7d55fd734ec9bda65e3620d401ad3147201ea9dbc086ca5dbb3e70c505b5 +size 47568 diff --git a/python-evdev.changes b/python-evdev.changes new file mode 100644 index 0000000..c7968a4 --- /dev/null +++ b/python-evdev.changes @@ -0,0 +1,158 @@ +------------------------------------------------------------------- +Wed Jan 29 19:36:45 UTC 2025 - Matthias Bach - 1.8.0 + +- Update to 1.8.0 + * The evdev.ecodes module is now generated at install time and + contains only constants. This allows type checking and + introspection of the evdev.ecodes module, without having to + execute it first. The old module is available as + evdev.ecodes_runtime. + * Reverse mappings in evdev.ecodes that point to more than one + value are now tuples instead of lists. + * Fix keyboard delay and repeat being swapped. + * Move the syn() convenience method from InputDevice to EventIO. +- Add fix-tests.patch to pull in test fixes that upstream only + included after tagging their release. +- Switch source download during packaging from disabledrun to + manualrun. + +------------------------------------------------------------------- +Thu May 9 09:18:42 UTC 2024 - Matthias Bach - 1.7.1 + +- Update to 1.7.1 + * Wait up to two seconds for uinput devices to appear. + +------------------------------------------------------------------- +Mon Feb 19 18:59:44 UTC 2024 - Matthias Bach - 1.7.0 + +- Update to 1.7.0 + * Add the uniq address to the string representation of InputDevice. + * Improved method for finding the device node corresponding to a + uinput device +- Adjust package build to upstream's switch to pyproject.toml. +- Drop obsolete Leap 15.3 compatiblity handling in spec file. + +------------------------------------------------------------------- +Wed Jul 12 12:35:05 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Mon Jan 23 14:25:52 UTC 2023 - Matthias Bach - 1.6.1 + +- Update to 1.6.1 + * No changelog was made available. +- Fix source URL as upstream no longer creates Github releases but + only tags. +- Add a _service file for easier source download. + +------------------------------------------------------------------- +Wed Jul 20 20:11:21 UTC 2022 - Matthias Bach - 1.6.0 + +- Update to 1.6.0 + * Fix Python 3.11 compatibility +- Drop packaging for Python 2 + +------------------------------------------------------------------- +Sat Mar 26 11:04:09 UTC 2022 - Matthias Bach - 1.5.0 + +- Update to 1.5.0 + * Input device is now closed from main thread in + InputDevice.close() + * util.find_ecodes_by_regex now works across all Python versions +- Drop evdev-re-Pattern.patch now included upstream + +------------------------------------------------------------------- +Mon Jan 10 20:16:20 UTC 2022 - Matthias Bach + +- Work around broken pytest macro on Leap 15.3 + +------------------------------------------------------------------- +Fri Apr 9 20:28:30 UTC 2021 - Ben Greiner + +- Add evdev-re-Pattern.patch -- gh#gvalkov/python-evdev#152 + +------------------------------------------------------------------- +Sat Jan 23 01:05:35 UTC 2021 - Dirk Müller + +- update to 1.4.0: +- Fix ``InputDevice.set_absinfo`` to allow setting parameters to zero. +- Fix off-by-one in ``ioctl_EVIOCG_bits``, which causes value at the end of the + list to not be reported back +- Fix ``set_absinfo`` to allow setting parameters to zero +- Fix leak when returning ``BlockingIOError`` from a read +- Fix "There is no current event loop in thread" error for non asyncio code +- Prevent ``InputDevice`` destructor from blocking +- Add missing return codes to ``os.strerror()`` calls and fix force feedback +- Add the ``util.find_ecodes_by_regex()`` helper function. + +------------------------------------------------------------------- +Thu Dec 24 18:16:44 UTC 2020 - Matthias Bach - 1.3.0 + +- Modernise spec file + +------------------------------------------------------------------- +Sun Jan 12 16:55:08 UTC 2020 - Matthias Bach + +- Update to 1.3.0 + * Fix build on 32bit arches with 64bit time_t. + * Add functionality to query device properties. See + InputDevice.input_props and the input_props argument to Uinput. + * KeyEvent received an allow_unknown constructor argument, which + determines what will happen when an event code cannot be mapped + to a keycode. The default and behavior so far has been to raise + KeyError. If set to True, the keycode will be set to the event + code formatted as a hex number. + * Add InputDevice.set_absinfo() and InputDevice.absinfo(). + * Instruct the asyncio event loop to stop monitoring the fd of + the input device when the device is closed. + +------------------------------------------------------------------- +Tue May 14 07:09:23 UTC 2019 - Ondřej Súkup + +- update to 1.2.0 + * Add UInput support for the resolution parameter in AbsInfo + * Vendor and product identifiers can be greater or equal to 0x8000 + +------------------------------------------------------------------- +Fri Mar 1 11:01:57 UTC 2019 - Tomáš Chvátal + +- Update to 1.1.2: + * Fix handling of absinfo capabilities + * Fix invalid example + * Check if FF_MAX_EFFECTS is defined + +------------------------------------------------------------------- +Tue Aug 28 08:00:44 UTC 2018 - marix@marix.org + +- Update to version 1.1.0 + * Add support for handling force-feedback effect uploads. + * Fix typo preventing force-feedback effects that need left + coefficients from working. +- Add _service file to fetch source from Git. + +------------------------------------------------------------------- +Tue Jun 5 20:06:40 UTC 2018 - marix@marix.org + +- Run tests during packaging. + * This runs only those tests which do not require /dev/uinput. +- Changed to source taken directly from Git instead of PyPI. + +------------------------------------------------------------------- +Mon Jun 4 20:07:15 UTC 2018 - marix@marix.org + +- Update to version 1.0.0 + * Fixed asyncio support in Python 3.5+. + * Fixed handling of missing data. + * Fixed device comparison. + * Deprecated the InputDevice.fn attribute in favour of + InputDevice.path + * Add a context manager for grabbing access to a device - + InputDevice.grab_context. + * Add the InputDevice.uniq attribute, which contains the unique + identifier of the device. + +------------------------------------------------------------------- +Mon Jan 29 15:33:32 UTC 2018 - jengelh@inai.de + +- Initial package for openSUSE distro diff --git a/python-evdev.spec b/python-evdev.spec new file mode 100644 index 0000000..97a8496 --- /dev/null +++ b/python-evdev.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-evdev +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define modname evdev +%{?sle15_python_module_pythons} +Name: python-evdev +Version: 1.8.0 +Release: 0 +Summary: Python bindings to the Linux input handling subsystem +License: BSD-3-Clause +Group: Development/Languages/Python +URL: https://github.com/gvalkov/python-evdev +# Source needs to be pulled form Github as the source distribution on PyPI lacks the test directory +Source: https://github.com/gvalkov/python-evdev/archive/refs/tags/v%{version}.tar.gz#/python-evdev-%{version}.tar.gz +Patch0: fix-tests.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools >= 61.0} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +%python_subpackages + +%description +python-evdev provides bindings to the generic input event interface +in Linux. The evdev interface serves the purpose of passing events +generated in the kernel directly to userspace through character +devices that are typically located in /dev/input/. + +This package also comes with bindings to uinput, the userspace input +subsystem. Uinput allows userspace programs to create and handle +input devices that can inject events directly into the input +subsystem. + +%prep +%autosetup -p1 + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}/%{$python_sitearch} +%python_expand rm %{buildroot}/%{$python_sitearch}/%{modname}/*.c + +%check +%pytest_arch tests -k 'not test_uinput' + +%files %{python_files} +%{python_sitearch}/evdev* +%license LICENSE + +%changelog