1{
2 lib,
3 aiohttp,
4 aiozoneinfo,
5 arrow,
6 buildPythonPackage,
7 cryptography,
8 fetchFromGitHub,
9 pyotp,
10 pytest-asyncio,
11 python-dotenv,
12 pytestCheckHook,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "opower";
18 version = "0.15.5";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "tronikos";
23 repo = "opower";
24 tag = "v${version}";
25 hash = "sha256-K0GYXubMKh2B7KYhZOaecBWArTBayl/Wq5Ha3jJyixE=";
26 };
27
28 build-system = [ setuptools ];
29
30 dependencies = [
31 aiohttp
32 aiozoneinfo
33 arrow
34 cryptography
35 pyotp
36 ];
37
38 nativeCheckInputs = [
39 pytest-asyncio
40 pytestCheckHook
41 python-dotenv
42 ];
43
44 disabledTestPaths = [
45 # network access
46 "tests/test_opower.py"
47 ];
48
49 pythonImportsCheck = [ "opower" ];
50
51 disabledTests = [
52 # Tests require network access
53 "test_invalid_auth"
54 ];
55
56 meta = with lib; {
57 description = "Module for getting historical and forecasted usage/cost from utilities that use opower.com";
58 homepage = "https://github.com/tronikos/opower";
59 changelog = "https://github.com/tronikos/opower/releases/tag/${src.tag}";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ fab ];
62 };
63}