From 51dadc07646d482ccdcb45452f7de217fead5675 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 18 Jan 2023 15:12:51 +0100 Subject: [PATCH] python3Packages.pyhon-miio: Fix tests with pytest 7.2 and clean up obsolete patches. --- .../python-modules/python-miio/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/python-miio/default.nix b/pkgs/development/python-modules/python-miio/default.nix index 32d5d542c30a..7e76da69c536 100644 --- a/pkgs/development/python-modules/python-miio/default.nix +++ b/pkgs/development/python-modules/python-miio/default.nix @@ -9,10 +9,12 @@ , cryptography , defusedxml , fetchPypi +, fetchpatch , importlib-metadata , micloud , netifaces , poetry-core +, pytest-asyncio , pytest-mock , pytestCheckHook , pythonOlder @@ -39,6 +41,14 @@ buildPythonPackage rec { poetry-core ]; + patches = [ + (fetchpatch { + # Fix pytest 7.2 compat + url = "https://github.com/rytilahti/python-miio/commit/67d9d771d04d51f5bd97f361ca1c15ae4a18c274.patch"; + hash = "sha256-Os9vCSKyieCqHs63oX6gcLrtv1N7hbX5WvEurelEp8w="; + }) + ]; + propagatedBuildInputs = [ android-backup appdirs @@ -59,18 +69,11 @@ buildPythonPackage rec { ]; checkInputs = [ + pytest-asyncio pytest-mock pytestCheckHook ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'defusedxml = "^0"' 'defusedxml = "*"' - # Will be fixed with the next release, https://github.com/rytilahti/python-miio/pull/1378 - substituteInPlace miio/integrations/vacuum/roborock/vacuum_cli.py \ - --replace "resultcallback" "result_callback" - ''; - pythonImportsCheck = [ "miio" ];