1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 fetchpatch,
8 freezegun,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "aiorecollect";
17 version = "2023.12.0";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "bachya";
24 repo = pname;
25 rev = "refs/tags/${version}";
26 hash = "sha256-Rj0+r7eERLY5VzmuDQH/TeVLfmvmKwPqcvd1b/To0Ts=";
27 };
28
29 postPatch = ''
30 # this is not used directly by the project
31 sed -i '/certifi =/d' pyproject.toml
32 '';
33
34 nativeBuildInputs = [ poetry-core ];
35
36 propagatedBuildInputs = [ aiohttp ];
37
38 __darwinAllowLocalNetworking = true;
39
40 nativeCheckInputs = [
41 aresponses
42 freezegun
43 pytest-asyncio
44 pytestCheckHook
45 ];
46
47 disabledTestPaths = [
48 # Ignore the examples directory as the files are prefixed with test_.
49 "examples/"
50 ];
51
52 pythonImportsCheck = [ "aiorecollect" ];
53
54 meta = with lib; {
55 description = "Python library for the Recollect Waste API";
56 longDescription = ''
57 aiorecollect is a Python asyncio-based library for the ReCollect
58 Waste API. It allows users to programmatically retrieve schedules
59 for waste removal in their area, including trash, recycling, compost
60 and more.
61 '';
62 homepage = "https://github.com/bachya/aiorecollect";
63 changelog = "https://github.com/bachya/aiorecollect/releases/tag/${version}";
64 license = with licenses; [ mit ];
65 maintainers = with maintainers; [ fab ];
66 };
67}