1{ lib, stdenv, buildPythonPackage, isPy3k, fetchFromGitHub
2, asgiref, autobahn, twisted, pytest-runner
3, hypothesis, pytest, pytest-asyncio, service-identity, pyopenssl
4}:
5buildPythonPackage rec {
6 pname = "daphne";
7 version = "3.0.2";
8
9 disabled = !isPy3k;
10
11 src = fetchFromGitHub {
12 owner = "django";
13 repo = pname;
14 rev = version;
15 sha256 = "sha256-KWkMV4L7bA2Eo/u4GGif6lmDNrZAzvYyDiyzyWt9LeI=";
16 };
17
18 nativeBuildInputs = [ pytest-runner ];
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 lib; {
31 description = "Django ASGI (HTTP/WebSocket) server";
32 license = licenses.bsd3;
33 homepage = "https://github.com/django/daphne";
34 };
35}