1{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
2, redis, channels, msgpack, aioredis, hiredis, asgiref
3# , fetchFromGitHub, async_generator, async-timeout, cryptography, pytest, pytest-asyncio
4}:
5
6buildPythonPackage rec {
7 pname = "channels-redis";
8 version = "2.4.0";
9
10 disabled = pythonOlder "3.6";
11
12 src = fetchPypi {
13 inherit version;
14 pname = "channels_redis";
15 sha256 = "1g4izdf8237pwxn85bv5igc2bajrvck1p2a7q448qmjfznrbrk5p";
16 };
17
18 buildInputs = [ redis hiredis ];
19
20 propagatedBuildInputs = [ channels msgpack aioredis asgiref ];
21
22 # Fetch from github (no tests files on pypi)
23 # src = fetchFromGitHub {
24 # rev = version;
25 # owner = "django";
26 # repo = "channels_redis";
27 # sha256 = "05niaqjv790mnrvca26kbnvb50fgnk2zh0k4np60cn6ilp4nl0kc";
28 # };
29 #
30 # checkInputs = [
31 # async_generator
32 # async-timeout
33 # cryptography
34 # pytest
35 # pytest-asyncio
36 # ];
37 #
38 # # Fails with : ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 6379)
39 # # (even with a local redis instance running)
40 # checkPhase = ''
41 # pytest -p no:django tests/
42 # '';
43
44 postPatch = ''
45 sed -i "s/msgpack~=0.6.0/msgpack/" setup.py
46 sed -i "s/aioredis~=1.0/aioredis/" setup.py
47 '';
48
49 meta = with stdenv.lib; {
50 homepage = "https://github.com/django/channels_redis/";
51 description = "Redis-backed ASGI channel layer implementation";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ mmai ];
54 };
55}