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 = "5.0.0";
25 format = "setuptools";
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-XOpsDTNcmnMypGDthynOq7TQxInHKFsKhtu/igF70SA=";
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 hiredis = [
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://github.com/redis/redis-py";
70 changelog = "https://github.com/redis/redis-py/releases/tag/v${version}";
71 license = with licenses; [ mit ];
72 };
73}