1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5 pythonOlder,
6
7 # propagates
8 async-timeout,
9 deprecated,
10 importlib-metadata,
11 packaging,
12 typing-extensions,
13
14 # extras: hiredis
15 hiredis,
16
17 # extras: ocsp
18 cryptography,
19 pyopenssl,
20 requests,
21}:
22
23buildPythonPackage rec {
24 pname = "redis";
25 version = "5.0.6";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchPypi {
31 inherit pname version;
32 hash = "sha256-OEc818Y4mtPkSpH0w+r2vLip90YAfym/T7IIJP8LIZc=";
33 };
34
35 propagatedBuildInputs = [
36 async-timeout
37 deprecated
38 packaging
39 typing-extensions
40 ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
41
42 passthru.optional-dependencies = {
43 hiredis = [ hiredis ];
44 ocsp = [
45 cryptography
46 pyopenssl
47 requests
48 ];
49 };
50
51 pythonImportsCheck = [
52 "redis"
53 "redis.client"
54 "redis.cluster"
55 "redis.connection"
56 "redis.exceptions"
57 "redis.sentinel"
58 "redis.utils"
59 ];
60
61 # Tests require a running redis
62 doCheck = false;
63
64 meta = with lib; {
65 description = "Python client for Redis key-value store";
66 homepage = "https://github.com/redis/redis-py";
67 changelog = "https://github.com/redis/redis-py/releases/tag/v${version}";
68 license = with licenses; [ mit ];
69 };
70}