nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 aiohttp,
7 ciso8601,
8 async-timeout,
9 kasa-crypt,
10 orjson,
11 requests,
12 websocket-client,
13 websockets,
14}:
15
16buildPythonPackage rec {
17 pname = "sense-energy";
18 version = "0.13.8";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "scottbonline";
23 repo = "sense";
24 tag = version;
25 hash = "sha256-hIE7wjKP+JcXQZ1lGbKCaKKK2ZlCF5BbJu3H7gqrsKU=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 aiohttp
37 async-timeout
38 kasa-crypt
39 orjson
40 ciso8601
41 requests
42 websocket-client
43 websockets
44 ];
45
46 # no tests implemented
47 doCheck = false;
48
49 pythonImportsCheck = [ "sense_energy" ];
50
51 meta = {
52 description = "API for the Sense Energy Monitor";
53 homepage = "https://github.com/scottbonline/sense";
54 changelog = "https://github.com/scottbonline/sense/releases/tag/${src.tag}";
55 license = lib.licenses.mit;
56 maintainers = with lib.maintainers; [ dotlambda ];
57 };
58}