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