forked from pool/python-pyu2f
Accepting request 1032663 from home:mcalabkova:branches:devel:languages:python
- Add upstream fix-deprecation-warning.patch to fix compatibility OBS-URL: https://build.opensuse.org/request/show/1032663 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyu2f?expand=0&rev=7
This commit is contained in:
59
fix-deprecation-warning.patch
Normal file
59
fix-deprecation-warning.patch
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
From 5e2f862dd5ba61eadff341dbf0a1202e91b1b145 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Cary Zhao <zhaosukima@gmail.com>
|
||||||
|
Date: Mon, 22 Nov 2021 10:42:06 -0800
|
||||||
|
Subject: [PATCH] fix DeprecationWarning for logging and fake_filesystem
|
||||||
|
|
||||||
|
---
|
||||||
|
pyu2f/hid/macos.py | 2 +-
|
||||||
|
pyu2f/tests/hid/linux_test.py | 12 ++++++------
|
||||||
|
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pyu2f/hid/macos.py b/pyu2f/hid/macos.py
|
||||||
|
index 905bce2..919fd4d 100644
|
||||||
|
--- a/pyu2f/hid/macos.py
|
||||||
|
+++ b/pyu2f/hid/macos.py
|
||||||
|
@@ -174,7 +174,7 @@ class _CFAllocator(_CFType):
|
||||||
|
ctypes.POINTER(ctypes.c_uint8),
|
||||||
|
CF_INDEX]
|
||||||
|
else:
|
||||||
|
- logger.warn('Not running on MacOS')
|
||||||
|
+ logger.warning('Not running on MacOS')
|
||||||
|
|
||||||
|
|
||||||
|
def CFStr(s):
|
||||||
|
diff --git a/pyu2f/tests/hid/linux_test.py b/pyu2f/tests/hid/linux_test.py
|
||||||
|
index 1a299fa..610d200 100644
|
||||||
|
--- a/pyu2f/tests/hid/linux_test.py
|
||||||
|
+++ b/pyu2f/tests/hid/linux_test.py
|
||||||
|
@@ -49,14 +49,14 @@
|
||||||
|
|
||||||
|
def AddDevice(fs, dev_name, product_name,
|
||||||
|
vendor_id, product_id, report_descriptor_b64):
|
||||||
|
- uevent = fs.CreateFile('/sys/class/hidraw/%s/device/uevent' % dev_name)
|
||||||
|
- rd = fs.CreateFile('/sys/class/hidraw/%s/device/report_descriptor' % dev_name)
|
||||||
|
+ uevent = fs.create_file('/sys/class/hidraw/%s/device/uevent' % dev_name)
|
||||||
|
+ rd = fs.create_file('/sys/class/hidraw/%s/device/report_descriptor' % dev_name)
|
||||||
|
report_descriptor = base64.b64decode(report_descriptor_b64)
|
||||||
|
- rd.SetContents(report_descriptor)
|
||||||
|
+ rd.set_contents(report_descriptor)
|
||||||
|
|
||||||
|
buf = 'HID_NAME=%s\n' % product_name.encode('utf8')
|
||||||
|
buf += 'HID_ID=0001:%08X:%08X\n' % (vendor_id, product_id)
|
||||||
|
- uevent.SetContents(buf)
|
||||||
|
+ uevent.set_contents(buf)
|
||||||
|
|
||||||
|
|
||||||
|
class FakeDeviceOsModule(object):
|
||||||
|
@@ -79,10 +79,10 @@ def read(self, unused_dev, unused_length): # pylint: disable=invalid-name
|
||||||
|
class LinuxTest(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.fs = fake_filesystem.FakeFilesystem()
|
||||||
|
- self.fs.CreateDirectory('/sys/class/hidraw')
|
||||||
|
+ self.fs.create_dir('/sys/class/hidraw')
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
- self.fs.RemoveObject('/sys/class/hidraw')
|
||||||
|
+ self.fs.remove_object('/sys/class/hidraw')
|
||||||
|
|
||||||
|
def testCallEnumerate(self):
|
||||||
|
AddDevice(self.fs, 'hidraw1', 'Logitech USB Keyboard',
|
@@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 1 09:26:18 UTC 2022 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
- Add upstream fix-deprecation-warning.patch to fix compatibility
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Apr 12 08:56:31 UTC 2022 - Markéta Machová <mmachova@suse.com>
|
Tue Apr 12 08:56:31 UTC 2022 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
@@ -24,6 +24,8 @@ Summary: U2F host library for interacting with a U2F device over USB
|
|||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/google/pyu2f/
|
URL: https://github.com/google/pyu2f/
|
||||||
Source: https://github.com/google/pyu2f/archive/refs/tags/%{version}.tar.gz#/pyu2f-%{version}.tar.gz
|
Source: https://github.com/google/pyu2f/archive/refs/tags/%{version}.tar.gz#/pyu2f-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM https://github.com/google/pyu2f/pull/32 fix DeprecationWarning for logging and fake_filesystem
|
||||||
|
Patch: fix-deprecation-warning.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
# SECTION test requirements
|
# SECTION test requirements
|
||||||
@@ -40,7 +42,7 @@ BuildArch: noarch
|
|||||||
U2F host library for interacting with a U2F device over USB.
|
U2F host library for interacting with a U2F device over USB.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pyu2f-%{version}
|
%autosetup -p1 -n pyu2f-%{version}
|
||||||
sed -i 's/import mock/from unittest import mock/' pyu2f/tests/*_test.py pyu2f/tests/hid/*_test.py
|
sed -i 's/import mock/from unittest import mock/' pyu2f/tests/*_test.py pyu2f/tests/hid/*_test.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
Reference in New Issue
Block a user