1{
2 lib,
3 aioboto3,
4 aiobotocore,
5 aiofiles,
6 aiohttp,
7 aiosqlite,
8 attrs,
9 buildPythonPackage,
10 faker,
11 fetchPypi,
12 itsdangerous,
13 motor,
14 poetry-core,
15 pytest-aiohttp,
16 pytestCheckHook,
17 pythonOlder,
18 redis,
19 url-normalize,
20}:
21
22buildPythonPackage rec {
23 pname = "aiohttp-client-cache";
24 version = "0.12.4";
25 pyproject = true;
26
27 disabled = pythonOlder "3.8";
28
29 src = fetchPypi {
30 pname = "aiohttp_client_cache";
31 inherit version;
32 hash = "sha256-5g/oFhNrWx1m87trJyq4HZeFTqHk2bVwhaNgQmln0mU=";
33 };
34
35 build-system = [ poetry-core ];
36
37 dependencies = [
38 aiohttp
39 attrs
40 itsdangerous
41 url-normalize
42 ];
43
44 optional-dependencies = {
45 all = [
46 aioboto3
47 aiobotocore
48 aiofiles
49 aiosqlite
50 motor
51 redis
52 ];
53 dynamodb = [
54 aioboto3
55 aiobotocore
56 ];
57 filesystem = [
58 aiofiles
59 aiosqlite
60 ];
61 mongodb = [ motor ];
62 redis = [ redis ];
63 sqlite = [ aiosqlite ];
64 };
65
66 nativeCheckInputs = [
67 faker
68 pytest-aiohttp
69 pytestCheckHook
70 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
71
72 pythonImportsCheck = [ "aiohttp_client_cache" ];
73
74 disabledTestPaths = [
75 # Tests require running instances of the services
76 "test/integration/test_dynamodb.py"
77 "test/integration/test_redis.py"
78 "test/integration/test_sqlite.py"
79 ];
80
81 meta = with lib; {
82 description = "Async persistent cache for aiohttp requests";
83 homepage = "https://github.com/requests-cache/aiohttp-client-cache";
84 changelog = "https://github.com/requests-cache/aiohttp-client-cache/blob/v${version}/HISTORY.md";
85 license = licenses.mit;
86 maintainers = with maintainers; [ seirl ];
87 };
88}