1{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub
2, asgiref, autobahn, twisted, pytestrunner
3, hypothesis, pytest, pytest-asyncio
4}:
5buildPythonPackage rec {
6 pname = "daphne";
7 version = "2.2.5";
8
9 disabled = !isPy3k;
10
11 src = fetchFromGitHub {
12 owner = "django";
13 repo = pname;
14 rev = version;
15 sha256 = "0ixgq1rr3s60bmrwx8qwvlvs3lag1c2nrmg4iy7wcmb8i1ddylqr";
16 };
17
18 nativeBuildInputs = [ pytestrunner ];
19
20 propagatedBuildInputs = [ asgiref autobahn twisted ];
21
22 checkInputs = [ hypothesis pytest pytest-asyncio ];
23
24 doCheck = !stdenv.isDarwin; # most tests fail on darwin
25
26 checkPhase = ''
27 py.test
28 '';
29
30 meta = with stdenv.lib; {
31 description = "Django ASGI (HTTP/WebSocket) server";
32 license = licenses.bsd3;
33 homepage = https://github.com/django/daphne;
34 };
35}