Skip to contentSkip to conversation

python3-evdev: upgrade 1.9.1 -> 1.9.2

PATCH In review Rene Muniz 2 participants 4 messages Sep 6, 2025 – Sep 8, 2025

lore
Share & tools
lore

Rene Muniz

author
#0 lore raw

PATCH 1/3 python3-evdev: upgrade 1.9.1 -> 1.9.2

From: Yoann Congal <[email protected]>

* Remove a merged reproducibility patch
* Adapt the --reproducible option

Changelog (from [0]):

1.9.2 (May 01, 2025)
====================
- Add the "--reproducible" build option which removes the build date and used headers from the generated ``ecodes.c``. Example usage::

    python -m build --config-setting=--build-option='build_ecodes --reproducible' -n

- Use ``Generic`` to set precise type for ``InputDevice.path``.

[0]: https://github.com/gvalkov/python-evdev/blob/v1.9.2/docs/changelog.rst

---
 ...ibility-option-for-building-ecodes.c.patch | 116 ------------------
 ...-evdev_1.9.1.bb => python3-evdev_1.9.2.bb} |   5 +-
 2 files changed, 2 insertions(+), 119 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch
 rename meta-python/recipes-devtools/python/{python3-evdev_1.9.1.bb => python3-evdev_1.9.2.bb} (75%)
meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch deleted +0 -116
deleted file mode 100644
index e730519884..0000000000
@@ -1,116 +0,0 @@
-From d05c1c9dd298cb95d7feccbddb5caa043a319a01 Mon Sep 17 00:00:00 2001
-From: Yoann Congal <[email protected]>
-Date: Sun, 13 Apr 2025 00:52:13 +0200
-Subject: [PATCH] Add a reproducibility option for building ecodes.c
-
-ecodes.c currently contains the kernel info of the build machine and the
-full path of the input*.h headers: This is not reproducible as output
-can change even is headers content do not. Downstream distributions
-might package ecodes.c and get non-reproducible output.
-
-To fix this: introduce a --reproducible option in the build:
-- in setup.py build_ecodes command
-- in underlying genecodes_c.py
-
-Note: These options are disabled by default so no change is expected in
-current builds.
-
-Signed-off-by: Yoann Congal <[email protected]>
-Upstream-Status: Submitted [https://github.com/gvalkov/python-evdev/pull/242]
----
- setup.py                 | 13 ++++++++++---
- src/evdev/genecodes_c.py | 17 +++++++++++------
- 2 files changed, 21 insertions(+), 9 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 6b721d7..3371199 100755
---- a/setup.py
-+++ b/setup.py
-@@ -14,7 +14,7 @@ curdir = Path(__file__).resolve().parent
- ecodes_c_path = curdir / "src/evdev/ecodes.c"
- 
- 
--def create_ecodes(headers=None):
-+def create_ecodes(headers=None, reproducibility=False):
-     if not headers:
-         include_paths = set()
-         cpath = os.environ.get("CPATH", "").strip()
-@@ -65,7 +65,10 @@ def create_ecodes(headers=None):
- 
-     print("writing %s (using %s)" % (ecodes_c_path, " ".join(headers)))
-     with ecodes_c_path.open("w") as fh:
--        cmd = [sys.executable, "src/evdev/genecodes_c.py", "--ecodes", *headers]
-+        cmd = [sys.executable, "src/evdev/genecodes_c.py"]
-+        if reproducibility:
-+            cmd.append("--reproducibility")
-+        cmd.extend(["--ecodes", *headers])
-         run(cmd, check=True, stdout=fh)
- 
- 
-@@ -74,17 +77,21 @@ class build_ecodes(Command):
- 
-     user_options = [
-         ("evdev-headers=", None, "colon-separated paths to input subsystem headers"),
-+        ("reproducibility", None, "hide host details (host/paths) to create a reproducible output"),
-     ]
- 
-     def initialize_options(self):
-         self.evdev_headers = None
-+        self.reproducibility = False
- 
-     def finalize_options(self):
-         if self.evdev_headers:
-             self.evdev_headers = self.evdev_headers.split(":")
-+        if self.reproducibility is None:
-+            self.reproducibility = False
- 
-     def run(self):
--        create_ecodes(self.evdev_headers)
-+        create_ecodes(self.evdev_headers, reproducibility=self.reproducibility)
- 
- 
- class build_ext(_build_ext.build_ext):
-diff --git a/src/evdev/genecodes_c.py b/src/evdev/genecodes_c.py
-index 5c2d946..24cad27 100644
---- a/src/evdev/genecodes_c.py
-+++ b/src/evdev/genecodes_c.py
-@@ -15,22 +15,27 @@ headers = [
-     "/usr/include/linux/uinput.h",
- ]
- 
--opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs"])
-+opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs", "reproducibility"])
- if not opts:
--    print("usage: genecodes.py [--ecodes|--stubs] <headers>")
-+    print("usage: genecodes.py [--ecodes|--stubs] [--reproducibility] <headers>")
-     exit(2)
- 
- if args:
-     headers = args
- 
-+reproducibility = ("--reproducibility", "") in opts
-+
- 
- # -----------------------------------------------------------------------------
- macro_regex = r"#define\s+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)"
- macro_regex = re.compile(macro_regex)
- 
--# Uname without hostname.
--uname = list(os.uname())
--uname = " ".join((uname[0], *uname[2:]))
-+if reproducibility:
-+    uname = "hidden for reproducibility"
-+else:
-+    # Uname without hostname.
-+    uname = list(os.uname())
-+    uname = " ".join((uname[0], *uname[2:]))
- 
- 
- # -----------------------------------------------------------------------------
-@@ -138,5 +143,5 @@ elif ("--stubs", "") in opts:
-     template = template_stubs
- 
- body = os.linesep.join(body)
--text = template % (uname, headers, body)
-+text = template % (uname, headers if not reproducibility else ["hidden for reproducibility"], body)
- print(text.strip())
meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb renamed from meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb +2 -3
similarity index 75%
rename from meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb
rename to meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb
index af88770c59..28c8ea4bc1 100644
@@ -3,8 +3,7 @@ HOMEPAGE = "https://github.com/gvalkov/python-evdev"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d7bd1cc4c71b706c7e2d4053aef50f2a"
 
-SRC_URI += "file://0001-Add-a-reproducibility-option-for-building-ecodes.c.patch"
-SRC_URI[sha256sum] = "dc640a064cb1c9fe1f8b970dc2039945a2a275d7b7ee62284bf427238abe45ee"
+SRC_URI[sha256sum] = "5d3278892ce1f92a74d6bf888cc8525d9f68af85dbe336c95d1c87fb8f423069"
 
 inherit pypi python_setuptools_build_meta
 
@@ -14,7 +13,7 @@ do_compile:prepend() {
 
 PEP517_BUILD_OPTS = "--config-setting=--build-option='build_ecodes \
     --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h \
-    --reproducibility'"
+    --reproducible'"
 
 RDEPENDS:${PN} += "\
     python3-ctypes \
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/3 python3-evdev: add missing uinput header

From: Yoann Congal <[email protected]>

Without uinput.h header, the evdev module can't be imported because it lacks the UI_FF* constants.

---
 meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb +1 -1
index 28c8ea4bc1..dc777cb987 100644
@@ -12,7 +12,7 @@ do_compile:prepend() {
 }
 
 PEP517_BUILD_OPTS = "--config-setting=--build-option='build_ecodes \
-    --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h \
+    --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h:${STAGING_DIR_TARGET}/usr/include/linux/uinput.h \
     --reproducible'"
 
 RDEPENDS:${PN} += "\
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 3/3 python3-evdev: add ptest

In reply to Rene Muniz

From: Yoann Congal <[email protected]>

root@qemux86-64:~# ptest-runner python3-evdev
START: ptest-runner
2025-05-02T22:19
BEGIN: /usr/lib/python3-evdev/ptest
[   61.988046] input: test-py-evdev-uinput as /devices/virtual/input/input18
[   61.990878] input: test-py-evdev-uinput as /devices/virtual/input/input19
[   61.993060] input: test-py-evdev-uinput as /devices/virtual/input/input20
[   61.994497] input: py-evdev-uinput as /devices/virtual/input/input21
[   61.996659] input: test-py-evdev-uinput as /devices/virtual/input/input22
PASS: tests/test_ecodes.py:test_equality
PASS: tests/test_ecodes.py:test_access
PASS: tests/test_ecodes.py:test_overlap
PASS: tests/test_ecodes.py:test_generated
PASS: tests/test_events.py:test_categorize
PASS: tests/test_events.py:test_keyevent
PASS: tests/test_uinput.py:test_open
PASS: tests/test_uinput.py:test_open_context
PASS: tests/test_uinput.py:test_maxnamelen
PASS: tests/test_uinput.py:test_enable_events
PASS: tests/test_uinput.py:test_abs_values
PASS: tests/test_uinput.py:test_write
PASS: tests/test_uinput.py:test_not_a_character_device
PASS: tests/test_uinput.py:test_not_a_character_device_2
PASS: tests/test_uinput.py:test_not_a_character_device_3
PASS: tests/test_util.py:test_match_ecodes_a
============================================================================
Testsuite summary
DURATION: 0
END: /usr/lib/python3-evdev/ptest
2025-05-02T22:19
STOP: ptest-runner
TOTAL: 1 FAIL: 0
---
 meta-python/conf/include/ptest-packagelists-meta-python.inc | 1 +
 meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
index ca91065af0..8a82db0edc 100644
@@ -21,6 +21,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-click \
     python3-dasbus \
     python3-dominate \
+    python3-evdev \
     python3-execnet \
     python3-flask \
     python3-flexcache \
meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb +1 -1
index dc777cb987..993dfca1e6 100644
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=d7bd1cc4c71b706c7e2d4053aef50f2a"
 
 SRC_URI[sha256sum] = "5d3278892ce1f92a74d6bf888cc8525d9f68af85dbe336c95d1c87fb8f423069"
 
-inherit pypi python_setuptools_build_meta
+inherit pypi python_setuptools_build_meta ptest-python-pytest
 
 do_compile:prepend() {
     rm -rf ${S}/evdev/ecodes.c
Signature · 1 line
2.34.1
#3 lore raw
In reply to Rene Muniz

Sent to the wrong mailing list~ This list is for patches to oe-core, you want the meta-openembeded mailing list:
[email protected]

Steve

Quoted 188 lines · Rene Muniz via lists.openembedded.org

From: Yoann Congal <[email protected]>

* Remove a merged reproducibility patch
* Adapt the --reproducible option

Changelog (from [0]):

1.9.2 (May 01, 2025)
====================
- Add the "--reproducible" build option which removes the build date and used headers from the generated ``ecodes.c``. Example usage::

    python -m build --config-setting=--build-option='build_ecodes --reproducible' -n

- Use ``Generic`` to set precise type for ``InputDevice.path``.

[0]: https://github.com/gvalkov/python-evdev/blob/v1.9.2/docs/changelog.rst

---
 ...ibility-option-for-building-ecodes.c.patch | 116 ------------------
 ...-evdev_1.9.1.bb => python3-evdev_1.9.2.bb} |   5 +-
 2 files changed, 2 insertions(+), 119 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch
 rename meta-python/recipes-devtools/python/{python3-evdev_1.9.1.bb => python3-evdev_1.9.2.bb} (75%)
meta-python/recipes-devtools/python/python3-evdev/0001-Add-a-reproducibility-option-for-building-ecodes.c.patch deleted +0 -116
deleted file mode 100644
index e730519884..0000000000
@@ -1,116 +0,0 @@
-From d05c1c9dd298cb95d7feccbddb5caa043a319a01 Mon Sep 17 00:00:00 2001
-From: Yoann Congal <[email protected]>
-Date: Sun, 13 Apr 2025 00:52:13 +0200
-Subject: [PATCH] Add a reproducibility option for building ecodes.c
-
-ecodes.c currently contains the kernel info of the build machine and the
-full path of the input*.h headers: This is not reproducible as output
-can change even is headers content do not. Downstream distributions
-might package ecodes.c and get non-reproducible output.
-
-To fix this: introduce a --reproducible option in the build:
-- in setup.py build_ecodes command
-- in underlying genecodes_c.py
-
-Note: These options are disabled by default so no change is expected in
-current builds.
-
-Signed-off-by: Yoann Congal <[email protected]>
-Upstream-Status: Submitted [https://github.com/gvalkov/python-evdev/pull/242]
----
- setup.py                 | 13 ++++++++++---
- src/evdev/genecodes_c.py | 17 +++++++++++------
- 2 files changed, 21 insertions(+), 9 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 6b721d7..3371199 100755
---- a/setup.py
-+++ b/setup.py
-@@ -14,7 +14,7 @@ curdir = Path(__file__).resolve().parent
- ecodes_c_path = curdir / "src/evdev/ecodes.c"
-
-
--def create_ecodes(headers=None):
-+def create_ecodes(headers=None, reproducibility=False):
-     if not headers:
-         include_paths = set()
-         cpath = os.environ.get("CPATH", "").strip()
-@@ -65,7 +65,10 @@ def create_ecodes(headers=None):
-
-     print("writing %s (using %s)" % (ecodes_c_path, " ".join(headers)))
-     with ecodes_c_path.open("w") as fh:
--        cmd = [sys.executable, "src/evdev/genecodes_c.py", "--ecodes", *headers]
-+        cmd = [sys.executable, "src/evdev/genecodes_c.py"]
-+        if reproducibility:
-+            cmd.append("--reproducibility")
-+        cmd.extend(["--ecodes", *headers])
-         run(cmd, check=True, stdout=fh)
-
-
-@@ -74,17 +77,21 @@ class build_ecodes(Command):
-
-     user_options = [
-         ("evdev-headers=", None, "colon-separated paths to input subsystem headers"),
-+        ("reproducibility", None, "hide host details (host/paths) to create a reproducible output"),
-     ]
-
-     def initialize_options(self):
-         self.evdev_headers = None
-+        self.reproducibility = False
-
-     def finalize_options(self):
-         if self.evdev_headers:
-             self.evdev_headers = self.evdev_headers.split(":")
-+        if self.reproducibility is None:
-+            self.reproducibility = False
-
-     def run(self):
--        create_ecodes(self.evdev_headers)
-+        create_ecodes(self.evdev_headers, reproducibility=self.reproducibility)
-
-
- class build_ext(_build_ext.build_ext):
-diff --git a/src/evdev/genecodes_c.py b/src/evdev/genecodes_c.py
-index 5c2d946..24cad27 100644
---- a/src/evdev/genecodes_c.py
-+++ b/src/evdev/genecodes_c.py
-@@ -15,22 +15,27 @@ headers = [
-     "/usr/include/linux/uinput.h",
- ]
-
--opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs"])
-+opts, args = getopt.getopt(sys.argv[1:], "", ["ecodes", "stubs", "reproducibility"])
- if not opts:
--    print("usage: genecodes.py [--ecodes|--stubs] <headers>")
-+    print("usage: genecodes.py [--ecodes|--stubs] [--reproducibility] <headers>")
-     exit(2)
-
- if args:
-     headers = args
-
-+reproducibility = ("--reproducibility", "") in opts
-+
-
- # -----------------------------------------------------------------------------
- macro_regex = r"#define\s+((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)"
- macro_regex = re.compile(macro_regex)
-
--# Uname without hostname.
--uname = list(os.uname())
--uname = " ".join((uname[0], *uname[2:]))
-+if reproducibility:
-+    uname = "hidden for reproducibility"
-+else:
-+    # Uname without hostname.
-+    uname = list(os.uname())
-+    uname = " ".join((uname[0], *uname[2:]))
-
-
- # -----------------------------------------------------------------------------
-@@ -138,5 +143,5 @@ elif ("--stubs", "") in opts:
-     template = template_stubs
-
- body = os.linesep.join(body)
--text = template % (uname, headers, body)
-+text = template % (uname, headers if not reproducibility else ["hidden for reproducibility"], body)
- print(text.strip())
meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb renamed from meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb +2 -4
similarity index 75%
rename from meta-python/recipes-devtools/python/python3-evdev_1.9.1.bb
rename to meta-python/recipes-devtools/python/python3-evdev_1.9.2.bb
index af88770c59..28c8ea4bc1 100644
@@ -3,8 +3,7 @@ HOMEPAGE = "https://github.com/gvalkov/python-evdev"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d7bd1cc4c71b706c7e2d4053aef50f2a"
 
-SRC_URI += "file://0001-Add-a-reproducibility-option-for-building-ecodes.c.patch"
-SRC_URI[sha256sum] = "dc640a064cb1c9fe1f8b970dc2039945a2a275d7b7ee62284bf427238abe45ee"
+SRC_URI[sha256sum] = "5d3278892ce1f92a74d6bf888cc8525d9f68af85dbe336c95d1c87fb8f423069"
 
 inherit pypi python_setuptools_build_meta
 
@@ -14,7 +13,7 @@ do_compile:prepend() {
 
 PEP517_BUILD_OPTS = "--config-setting=--build-option='build_ecodes \
     --evdev-headers ${STAGING_DIR_TARGET}/usr/include/linux/input.h:${STAGING_DIR_TARGET}/usr/include/linux/input-event-codes.h \
-    --reproducibility'"
+    --reproducible'"
 
 RDEPENDS:${PN} += "\
     python3-ctypes \
--

2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#223043): https://lists.openembedded.org/g/openembedded-core/message/223043
Mute This Topic: https://lists.openembedded.org/mt/115098119/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-