summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/yeelight/default.nix
blob: 443b4daec854a501479905979361e78df0617297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib
, fetchgit
, buildPythonPackage
, pythonOlder
, enum-compat
, future
, ifaddr
, mock
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "yeelight";
  version = "0.5.4";

  src = fetchgit {
    url = "https://gitlab.com/stavros/python-yeelight.git";
    rev = "119faeff0d4f9de8c7f6d0580bdecc1c79bcdaea"; # v0.5.4 wasn't tagged
    sha256 = "0j2c5pzd3kny7ghr9q7xn9vs8dffvyzz5igaavvvd04w7aph29sy";
  };

  propagatedBuildInputs = [
    future
    ifaddr
  ] ++ lib.optional (pythonOlder "3.4") enum-compat;

  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;
    maintainers = with maintainers; [ nyanloutre ];
  };
}