Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, fetchpatch
7, freezegun
8, poetry-core
9, pyjwt
10, pytest-aiohttp
11, pytest-asyncio
12, pytestCheckHook
13, pythonOlder
14, pytz
15, titlecase
16, types-pytz
17}:
18
19buildPythonPackage rec {
20 pname = "aioridwell";
21 version = "2023.08.0";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "bachya";
28 repo = pname;
29 rev = "refs/tags/${version}";
30 hash = "sha256-AreQC5LOthnOEj0HnEww4zLob394XwCvqZBwjsT2Lcg=";
31 };
32
33 patches = [
34 # This patch removes references to setuptools and wheel that are no longer
35 # necessary and changes poetry to poetry-core, so that we don't need to add
36 # unnecessary nativeBuildInputs.
37 #
38 # https://github.com/bachya/aioridwell/pull/234
39 #
40 (fetchpatch {
41 name = "clean-up-build-dependencies.patch";
42 url = "https://github.com/bachya/aioridwell/commit/79a9dd7462dcfeb0833abca73a1f184827120a6f.patch";
43 hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
44 })
45 ];
46
47 nativeBuildInputs = [
48 poetry-core
49 ];
50
51 propagatedBuildInputs = [
52 aiohttp
53 pyjwt
54 pytz
55 titlecase
56 ];
57
58 __darwinAllowLocalNetworking = true;
59
60 nativeCheckInputs = [
61 aresponses
62 freezegun
63 pytest-aiohttp
64 pytest-asyncio
65 pytestCheckHook
66 types-pytz
67 ];
68
69 disabledTests = [
70 # AssertionError: assert datetime.date(...
71 "test_get_next_pickup_event"
72 ];
73
74 disabledTestPaths = [
75 # Ignore the examples directory as the files are prefixed with test_
76 "examples/"
77 ];
78
79 pythonImportsCheck = [
80 "aioridwell"
81 ];
82
83 meta = with lib; {
84 description = "Python library for interacting with Ridwell waste recycling";
85 homepage = "https://github.com/bachya/aioridwell";
86 changelog = "https://github.com/bachya/aioridwell/releases/tag/${version}";
87 license = with licenses; [ mit ];
88 maintainers = with maintainers; [ fab ];
89 };
90}