From f361a31f75f3e973ad5bea8ceeb6ce15e231efc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 14:22:44 +0200 Subject: [PATCH 1/3] pythonPackages.colorthief: init at 0.2.1 --- .../python-modules/colorthief/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/colorthief/default.nix diff --git a/pkgs/development/python-modules/colorthief/default.nix b/pkgs/development/python-modules/colorthief/default.nix new file mode 100644 index 000000000000..cdb37df3e392 --- /dev/null +++ b/pkgs/development/python-modules/colorthief/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pillow +}: + +buildPythonPackage rec { + pname = "colorthief"; + version = "0.2.1"; + + src = fetchFromGitHub { + owner = "fengsp"; + repo = "color-thief-py"; + rev = version; + sha256 = "0lzpflal1iqbj4k7hayss5z024qf2sn8c3wxw03a0mgxg06ca2hm"; + }; + + propagatedBuildInputs = [ + pillow + ]; + + # no tests implemented + doCheck = false; + + pythonImportsCheck = [ "colorthief" ]; + + meta = with lib; { + description = "Python module for grabbing the color palette from an image"; + homepage = "https://github.com/fengsp/color-thief-py"; + license = licenses.bsd3; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 528d5dffbf76..2a6ecd02d82d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1563,6 +1563,8 @@ in { colorspacious = callPackage ../development/python-modules/colorspacious { }; + colorthief = callPackage ../development/python-modules/colorthief { }; + colour = callPackage ../development/python-modules/colour { }; commandparse = callPackage ../development/python-modules/commandparse { }; From f8683671f7355ec3a87844c87c0da3e4daa9ff4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 14:23:09 +0200 Subject: [PATCH 2/3] home-assistant: update component-packages.nix --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 04abaab961a9..8e70d71b4459 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -130,7 +130,7 @@ "cmus" = ps: with ps; [ ]; # missing inputs: pycmus "co2signal" = ps: with ps; [ ]; # missing inputs: co2signal "coinbase" = ps: with ps; [ ]; # missing inputs: coinbase - "color_extractor" = ps: with ps; [ ]; # missing inputs: colorthief + "color_extractor" = ps: with ps; [ colorthief ]; "comed_hourly_pricing" = ps: with ps; [ ]; "comfoconnect" = ps: with ps; [ pycomfoconnect ]; "command_line" = ps: with ps; [ ]; From 030c21580b04ba2eeca44cadfe314797f0fe962d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 16 Jun 2021 14:24:33 +0200 Subject: [PATCH 3/3] home-assistant: test color_extractor component --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index ac84462d9f39..d969784ebfc1 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -327,6 +327,7 @@ in with py.pkgs; buildPythonApplication rec { "climate" "cloud" "cloudflare" + "color_extractor" "comfoconnect" "command_line" "compensation"