From adcdfe29bfa710c326552d8c568fdb7a23c82709 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 19 Feb 2024 01:01:50 +0100 Subject: [PATCH] python311Packages.xknx: fix pytest-asyncio 0.22 compat and some light updates to dependency handling. --- .../python-modules/xknx/default.nix | 9 ++++-- .../xknx/pytest-asyncio-0.22-compat.patch | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/python-modules/xknx/pytest-asyncio-0.22-compat.patch diff --git a/pkgs/development/python-modules/xknx/default.nix b/pkgs/development/python-modules/xknx/default.nix index 91721fdd169a..0938d12b573d 100644 --- a/pkgs/development/python-modules/xknx/default.nix +++ b/pkgs/development/python-modules/xknx/default.nix @@ -8,7 +8,6 @@ , pytestCheckHook , pythonOlder , setuptools -, wheel }: buildPythonPackage rec { @@ -25,15 +24,19 @@ buildPythonPackage rec { hash = "sha256-Fwo76tvkLLx8QJeokuGohhnt83eGBMyWIUSHJGuQWJ4="; }; + patches = [ + ./pytest-asyncio-0.22-compat.patch + ]; + nativeBuildInputs = [ setuptools - wheel ]; propagatedBuildInputs = [ - async-timeout cryptography ifaddr + ] ++ lib.optionals (pythonOlder "3.11") [ + async-timeout ]; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/xknx/pytest-asyncio-0.22-compat.patch b/pkgs/development/python-modules/xknx/pytest-asyncio-0.22-compat.patch new file mode 100644 index 000000000000..2688ceb1fdd6 --- /dev/null +++ b/pkgs/development/python-modules/xknx/pytest-asyncio-0.22-compat.patch @@ -0,0 +1,28 @@ +diff --git a/test/devices_tests/datetime_test.py b/test/devices_tests/datetime_test.py +index af06abc6..2145fcc1 100644 +--- a/test/devices_tests/datetime_test.py ++++ b/test/devices_tests/datetime_test.py +@@ -12,11 +12,6 @@ from xknx.telegram.apci import GroupValueRead, GroupValueResponse, GroupValueWri + class TestDateTime: + """Test class for DateTime object.""" + +- # pylint: disable=attribute-defined-outside-init +- def teardown_method(self): +- """Cancel broadcast_task.""" +- self.datetime.__del__() +- + # + # SET Time + # +diff --git a/test/io_tests/secure_session_test.py b/test/io_tests/secure_session_test.py +index cd2dc1d0..ca90e2d9 100644 +--- a/test/io_tests/secure_session_test.py ++++ b/test/io_tests/secure_session_test.py +@@ -65,7 +65,6 @@ class TestSecureSession: + + def teardown_method(self): + """Cancel keepalive task.""" +- self.session.stop() + self.patch_serial_number.stop() + self.patch_message_tag.stop() +