From 657c387464585bce1ac031b51b2098ebd85efafb Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 9 Oct 2020 17:10:28 +0200 Subject: [PATCH] pythonPackages.yeelight: 0.5.3 -> 0.5.4 Use pytestCheckhook for testing. --- .../python-modules/yeelight/default.nix | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/yeelight/default.nix b/pkgs/development/python-modules/yeelight/default.nix index 4cc7056da19..443b4daec85 100644 --- a/pkgs/development/python-modules/yeelight/default.nix +++ b/pkgs/development/python-modules/yeelight/default.nix @@ -1,17 +1,38 @@ -{ stdenv, fetchPypi, buildPythonPackage, future, enum-compat }: +{ lib +, fetchgit +, buildPythonPackage +, pythonOlder +, enum-compat +, future +, ifaddr +, mock +, pytestCheckHook +}: buildPythonPackage rec { pname = "yeelight"; - version = "0.5.3"; + version = "0.5.4"; - src = fetchPypi { - inherit pname version; - sha256 = "8d49846f0cede1e312cbcd1d0e44c42073910bbcadb31b87ce2a7d24dea3af38"; + src = fetchgit { + url = "https://gitlab.com/stavros/python-yeelight.git"; + rev = "119faeff0d4f9de8c7f6d0580bdecc1c79bcdaea"; # v0.5.4 wasn't tagged + sha256 = "0j2c5pzd3kny7ghr9q7xn9vs8dffvyzz5igaavvvd04w7aph29sy"; }; - propagatedBuildInputs = [ future enum-compat ]; + propagatedBuildInputs = [ + future + ifaddr + ] ++ lib.optional (pythonOlder "3.4") enum-compat; - meta = with stdenv.lib; { + checkInputs = [ + pytestCheckHook + ] ++ lib.optional (pythonOlder "3.3") mock; + + pytestFlagsArray = [ "yeelight/tests.py" ]; + + pythonImportsCheck = [ "yeelight" ]; + + meta = with lib; { description = "A Python library for controlling YeeLight RGB bulbs"; homepage = "https://gitlab.com/stavros/python-yeelight/"; license = licenses.asl20;