diff mbox series

[meta-python,13/24] python3-pyu2f: drop the six dependency

Message ID 20260921115500.53770-13-f_l_k@t-online.de
State Under Review
Headers show
Series [meta-python,01/24] nvmetcli: drop the six dependency | expand

Commit Message

Markus Volk Sept. 21, 2026, 11:54 a.m. UTC
Patch pyu2f to use queue, range and the input builtin instead of the
six.moves aliases, and drop the runtime dependency.

Built for intel-corei7-64.

AI-Generated: Uses Claude Code (Claude Opus 5)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 .../0001-drop-the-six-dependency.patch        | 70 +++++++++++++++++++
 .../python/python3-pyu2f_0.1.5.bb             |  2 +-
 2 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-pyu2f/0001-drop-the-six-dependency.patch
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pyu2f/0001-drop-the-six-dependency.patch b/meta-python/recipes-devtools/python/python3-pyu2f/0001-drop-the-six-dependency.patch
new file mode 100644
index 0000000000..87a6ab9fa0
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pyu2f/0001-drop-the-six-dependency.patch
@@ -0,0 +1,70 @@ 
+From eb27c7a2a85f2ac21ea9fa0d30979b04fdb0f671 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Mon, 21 Sep 2026 13:23:08 +0200
+Subject: [PATCH] drop the six dependency
+
+six is a Python 2 compatibility shim and pyu2f does not need it on
+Python 3: six.moves.queue and six.moves.range are queue and range, and
+six.moves.input is input.
+
+Upstream-Status: Pending
+
+AI-Generated: Uses Claude Code (Claude Opus 5)
+---
+ pyu2f/convenience/localauthenticator.py | 3 +--
+ pyu2f/hid/macos.py                      | 3 +--
+ setup.py                                | 3 ---
+ 3 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/pyu2f/convenience/localauthenticator.py b/pyu2f/convenience/localauthenticator.py
+index b03fa57..2b6b22a 100644
+--- a/pyu2f/convenience/localauthenticator.py
++++ b/pyu2f/convenience/localauthenticator.py
+@@ -13,7 +13,6 @@
+ # limitations under the License.
+ 
+ """Convenience class for U2F signing with local security keys."""
+-import six
+ import base64
+ import sys
+ 
+@@ -36,7 +35,7 @@ class LocalAuthenticator(baseauthenticator.BaseAuthenticator):
+       device = u2f.GetLocalU2FInterface(origin=self.origin)
+     except errors.NoDeviceFoundError:
+       print_callback('Please insert your security key and press enter...')
+-      six.moves.input()
++      input()
+       device = u2f.GetLocalU2FInterface(origin=self.origin)
+ 
+     print_callback('Please touch your security key.\n')
+diff --git a/pyu2f/hid/macos.py b/pyu2f/hid/macos.py
+index 905bce2..a2ed2e6 100644
+--- a/pyu2f/hid/macos.py
++++ b/pyu2f/hid/macos.py
+@@ -13,11 +13,10 @@
+ # limitations under the License.
+ 
+ """Implements HID device interface on MacOS using IOKit and HIDManager."""
+-from six.moves import queue
+-from six.moves import range
+ import ctypes
+ import ctypes.util
+ import logging
++import queue
+ import sys
+ import threading
+ 
+diff --git a/setup.py b/setup.py
+index 663706b..184be89 100644
+--- a/setup.py
++++ b/setup.py
+@@ -36,9 +36,6 @@ setuptools.setup(
+     author_email='pyu2f-team@google.com',
+     # Contained modules and scripts.
+     packages=setuptools.find_packages(exclude=["pyu2f.tests", "pyu2f.tests.*"]),
+-    install_requires=[
+-        'six',
+-    ],
+     tests_require=[
+         'unittest2>=0.5.1',
+         'pyfakefs>=2.4',
diff --git a/meta-python/recipes-devtools/python/python3-pyu2f_0.1.5.bb b/meta-python/recipes-devtools/python/python3-pyu2f_0.1.5.bb
index 5a2899e132..083fed68f6 100644
--- a/meta-python/recipes-devtools/python/python3-pyu2f_0.1.5.bb
+++ b/meta-python/recipes-devtools/python/python3-pyu2f_0.1.5.bb
@@ -3,6 +3,7 @@  HOMEPAGE = "https://github.com/google/pyu2f/"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
+SRC_URI += "file://0001-drop-the-six-dependency.patch"
 SRC_URI[sha256sum] = "a3caa3a11842fc7d5746376f37195e6af5f17c0a15737538bb1cebf656fb306b"
 
 inherit pypi setuptools3
@@ -16,5 +17,4 @@  RDEPENDS:${PN} += " \
     python3-logging \
     python3-netclient \
     python3-threading \
-    python3-six \
 "