1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 aiohttp,
8 urllib3,
9 orjson,
10 aresponses,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "tesla-powerwall";
16 version = "0.5.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "jrester";
23 repo = "tesla_powerwall";
24 tag = "v${version}";
25 hash = "sha256-cAsJKFM0i0e7w2T4HP4a5ybJGuDvBAGCGmPEKFzNFAY=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [
31 aiohttp
32 urllib3
33 orjson
34 ];
35
36 nativeCheckInputs = [
37 aresponses
38 pytestCheckHook
39 ];
40
41 disabledTests = [
42 # yarl compat issue https://github.com/jrester/tesla_powerwall/issues/68
43 "test_parse_endpoint"
44 ];
45
46 enabledTestPaths = [ "tests/unit" ];
47
48 pythonImportsCheck = [ "tesla_powerwall" ];
49
50 meta = with lib; {
51 description = "API for Tesla Powerwall";
52 homepage = "https://github.com/jrester/tesla_powerwall";
53 changelog = "https://github.com/jrester/tesla_powerwall/blob/v${version}/CHANGELOG";
54 license = licenses.mit;
55 maintainers = with maintainers; [ dotlambda ];
56 };
57}