1{ lib, 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 = "3.0.1";
8
9 disabled = !isPy3k;
10
11 src = fetchFromGitHub {
12 owner = "django";
13 repo = pname;
14 rev = version;
15 sha256 = "1bkxhzvaqwz760c11nhaiwvsq1d1csmk5dz2a1j1ynypjprhvhsk";
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 lib; {
31 description = "Django ASGI (HTTP/WebSocket) server";
32 license = licenses.bsd3;
33 homepage = "https://github.com/django/daphne";
34 };
35}