1{ lib
2, stdenv
3, asgiref
4, autobahn
5, buildPythonPackage
6, django
7, fetchFromGitHub
8, hypothesis
9, pytest-asyncio
10, pytestCheckHook
11, pythonOlder
12, twisted
13}:
14
15buildPythonPackage rec {
16 pname = "daphne";
17 version = "4.0.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "django";
24 repo = pname;
25 rev = version;
26 hash = "sha256-vPMrmC2B0Pcvk8Y1FsJ4PXnzIMtPod7lL2u0IYNVUxc=";
27 };
28
29 propagatedBuildInputs = [
30 asgiref
31 autobahn
32 twisted
33 ] ++ twisted.optional-dependencies.tls;
34
35 nativeCheckInputs = [
36 django
37 hypothesis
38 pytest-asyncio
39 pytestCheckHook
40 ];
41
42 postPatch = ''
43 substituteInPlace setup.py \
44 --replace "pytest-runner" ""
45 '';
46
47 # Most tests fail on darwin
48 doCheck = !stdenv.isDarwin;
49
50 pythonImportsCheck = [
51 "daphne"
52 ];
53
54 meta = with lib; {
55 description = "Django ASGI (HTTP/WebSocket) server";
56 homepage = "https://github.com/django/daphne";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ ];
59 };
60}