From a78ac90bfe2c0e3e79ed408fb9b0cd264a5bc106 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 28 Jan 2023 19:19:16 +0100 Subject: [PATCH] python311Packages.volvooncall: add patch to remove asynctest --- .../python-modules/volvooncall/default.nix | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/volvooncall/default.nix b/pkgs/development/python-modules/volvooncall/default.nix index 604901c8da7e..f3df712c3d51 100644 --- a/pkgs/development/python-modules/volvooncall/default.nix +++ b/pkgs/development/python-modules/volvooncall/default.nix @@ -1,34 +1,43 @@ { lib -, buildPythonPackage -, pythonOlder -, fetchFromGitHub -, setuptools -, geopy -, docopt -, certifi -, amqtt -, websockets , aiohttp -, pytestCheckHook -, asynctest +, amqtt +, buildPythonPackage +, certifi +, docopt +, fetchFromGitHub +, fetchpatch +, geopy +, mock , pytest-asyncio +, pytestCheckHook +, pythonOlder +, setuptools +, websockets }: buildPythonPackage rec { pname = "volvooncall"; version = "0.10.1"; + format = "setuptools"; disabled = pythonOlder "3.8"; - format = "setuptools"; - src = fetchFromGitHub { owner = "molobrakos"; repo = "volvooncall"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-udYvgKj7Rlc/hA86bbeBfnoVRjKkXT4TwpceWz226cU="; }; + patches = [ + # Remove async, https://github.com/molobrakos/volvooncall/pull/92 + (fetchpatch { + name = "remove-asnyc.patch"; + url = "https://github.com/molobrakos/volvooncall/commit/ef0df403250288c00ed4c600e9dfa79dcba8941e.patch"; + hash = "sha256-U+hM7vzD9JSEUumvjPSLpVQcc8jAuZHG3/1dQ3wnIcA="; + }) + ]; + propagatedBuildInputs = [ aiohttp ]; @@ -45,17 +54,20 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = [ - asynctest + checkInputs = [ + mock pytest-asyncio pytestCheckHook ] ++ passthru.optional-dependencies.mqtt; - pythonImportsCheck = [ "volvooncall" ]; + pythonImportsCheck = [ + "volvooncall" + ]; meta = with lib; { description = "Retrieve information from the Volvo On Call web service"; homepage = "https://github.com/molobrakos/volvooncall"; + changelog = "https://github.com/molobrakos/volvooncall/releases/tag/v${version}"; license = licenses.unlicense; maintainers = with maintainers; [ dotlambda ]; };