1{
2 lib,
3 aiohttp,
4 async-timeout,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytest-timeout,
10 pytestCheckHook,
11 pythonOlder,
12 python-dotenv,
13}:
14
15buildPythonPackage rec {
16 pname = "aiopvpc";
17 version = "4.3.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "azogue";
24 repo = "aiopvpc";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-1xeXfhoXRfJ7vrpRPeYmwcAGjL09iNCOm/f4pPvuZLU=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail " --cov --cov-report term --cov-report html" ""
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 aiohttp
38 async-timeout
39 ];
40
41 nativeCheckInputs = [
42 pytest-asyncio
43 pytest-timeout
44 pytestCheckHook
45 python-dotenv
46 ];
47
48 pythonImportsCheck = [ "aiopvpc" ];
49
50 meta = with lib; {
51 description = "Python module to download Spanish electricity hourly prices (PVPC)";
52 homepage = "https://github.com/azogue/aiopvpc";
53 changelog = "https://github.com/azogue/aiopvpc/blob/v${version}/CHANGELOG.md";
54 license = with licenses; [ mit ];
55 maintainers = with maintainers; [ fab ];
56 };
57}