1{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub
2, asgiref, autobahn, twisted, pytestrunner
3, hypothesis, pytest, pytest-asyncio, service-identity, pyopenssl
4}:
5buildPythonPackage rec {
6 pname = "daphne";
7 version = "2.5.0";
8
9 disabled = !isPy3k;
10
11 src = fetchFromGitHub {
12 owner = "django";
13 repo = pname;
14 rev = version;
15 sha256 = "0qkhmblj3a5s3z65cgz46xsvq1b6x4m3kr6aljjnxnv7hcwib02n";
16 };
17
18 nativeBuildInputs = [ pytestrunner ];
19
20 propagatedBuildInputs = [ asgiref autobahn twisted service-identity pyopenssl ];
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}