1{ lib
2, aiohttp
3, async-timeout
4, backports-zoneinfo
5, buildPythonPackage
6, fetchFromGitHub
7, holidays
8, poetry-core
9, pytest-asyncio
10, pytest-timeout
11, pytestCheckHook
12, pythonOlder
13, tzdata
14}:
15
16buildPythonPackage rec {
17 pname = "aiopvpc";
18 version = "3.0.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "azogue";
25 repo = pname;
26 rev = "v${version}";
27 sha256 = "sha256-eTCQddoZIaCs7iKGNBC8aSq6ek4vwYXgIXx35UlME/k=";
28 };
29
30 nativeBuildInputs = [
31 poetry-core
32 ];
33
34 propagatedBuildInputs = [
35 aiohttp
36 holidays
37 tzdata
38 async-timeout
39 ] ++ lib.optionals (pythonOlder "3.9") [
40 backports-zoneinfo
41 ];
42
43 checkInputs = [
44 pytest-asyncio
45 pytest-timeout
46 pytestCheckHook
47 ];
48
49 disabledTests = [
50 # Failures seem related to changes in holidays-0.13, https://github.com/azogue/aiopvpc/issues/44
51 "test_number_of_national_holidays"
52 ];
53
54 postPatch = ''
55 substituteInPlace pyproject.toml --replace \
56 " --cov --cov-report term --cov-report html" ""
57 '';
58
59 pythonImportsCheck = [
60 "aiopvpc"
61 ];
62
63 meta = with lib; {
64 description = "Python module to download Spanish electricity hourly prices (PVPC)";
65 homepage = "https://github.com/azogue/aiopvpc";
66 license = with licenses; [ mit ];
67 maintainers = with maintainers; [ fab ];
68 };
69}