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