Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / sense-energy / default.nix
blob35c0b4b6f4f86bc0c78b1d6eba291cb2a7b495c8
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , aiohttp
5 , ciso8601
6 , async-timeout
7 , kasa-crypt
8 , orjson
9 , pythonOlder
10 , requests
11 , websocket-client
12 , websockets
15 buildPythonPackage rec {
16   pname = "sense-energy";
17   version = "0.12.2";
18   format = "setuptools";
20   disabled = pythonOlder "3.7";
22   src = fetchFromGitHub {
23     owner = "scottbonline";
24     repo = "sense";
25     rev = "refs/tags/${version}";
26     hash = "sha256-OVFRM31LwHNeJUx+s/TN/1o4wvjMQEKaZEPI+y+S64s=";
27   };
29   postPatch = ''
30     substituteInPlace setup.py \
31       --replace "{{VERSION_PLACEHOLDER}}" "${version}"
32   '';
34   propagatedBuildInputs = [
35     aiohttp
36     async-timeout
37     kasa-crypt
38     orjson
39     ciso8601
40     requests
41     websocket-client
42     websockets
43   ];
45   # no tests implemented
46   doCheck = false;
48   pythonImportsCheck = [
49     "sense_energy"
50   ];
52   meta = with lib; {
53     description = "API for the Sense Energy Monitor";
54     homepage = "https://github.com/scottbonline/sense";
55     changelog = "https://github.com/scottbonline/sense/releases/tag/${version}";
56     license = licenses.mit;
57     maintainers = with maintainers; [ dotlambda ];
58   };