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