diff --git a/pytest-catch-warnings.patch b/pytest-catch-warnings.patch new file mode 100644 index 0000000..0e197f1 --- /dev/null +++ b/pytest-catch-warnings.patch @@ -0,0 +1,51 @@ +--- hid-parser-0.0.3/tests/test_items.py ++++ hid-parser-0.0.3/tests/test_items.py +@@ -5,7 +5,7 @@ + import pytest + + import hid_parser +- ++import warnings + + def test_baseitem(): + item = hid_parser.BaseItem(1, 2) +@@ -129,14 +129,18 @@ + with pytest.warns(hid_parser.HIDComplianceWarning): + hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0001), -1, 1) + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0030), -1, 1) ++ warnings.simplefilter("error") + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0001, 0x0000), -1, 1) ++ warnings.simplefilter("error") + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.VariableItem(1, 2, 0, hid_parser.Usage(0x0000, 0x0000), -1, 1) ++ warnings.simplefilter("error") ++ + + + def test_arrayitem(): +@@ -179,11 +183,14 @@ + with pytest.warns(hid_parser.HIDComplianceWarning): + hid_parser.ArrayItem(1, 2, 0, usages, -1, 1) + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.ArrayItem(1, 2, 0, usages, -1, 1) ++ warnings.simplefilter("error") + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.ArrayItem(1, 2, 0, usages, -1, 1) ++ warnings.simplefilter("error") + +- with pytest.warns(None): ++ with warnings.catch_warnings(): + hid_parser.ArrayItem(1, 2, 0, usages, -1, 1) ++ warnings.simplefilter("error") diff --git a/python-hid-parser.changes b/python-hid-parser.changes index b4c2af9..6932bfc 100644 --- a/python-hid-parser.changes +++ b/python-hid-parser.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 20 10:23:16 UTC 2024 - Dirk Müller + +- add pytest-catch-warnings.patch to fix build with newer + pytest/python 3.13 + ------------------------------------------------------------------- Mon Nov 7 15:12:36 UTC 2022 - Dominique Leuenberger diff --git a/python-hid-parser.spec b/python-hid-parser.spec index ca6714c..deca474 100644 --- a/python-hid-parser.spec +++ b/python-hid-parser.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-hid-parser # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,8 @@ Release: 0 Summary: Parse HID report descriptors License: MIT URL: https://github.com/FFY00/python-hid-parser -Source0: https://files.pythonhosted.org/packages/48/af/6266119b18570fee7dc838c3389e37db3586a4e2003de709cf4ac24e395a/hid-parser-0.0.3.tar.gz +Source0: https://files.pythonhosted.org/packages/source/h/hid-parser/hid-parser-%{version}.tar.gz +Patch1: pytest-catch-warnings.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -42,7 +43,7 @@ Conflicts: solaar < 1.1.7 Typed pure Python library to parse HID report descriptors %prep -%setup -q -n %{pkg_name}-%{version} +%autosetup -p1 -n %{pkg_name}-%{version} %build %pyproject_wheel