1{
2 lib,
3 asgiref,
4 buildPythonPackage,
5 daphne,
6 django,
7 fetchFromGitHub,
8 async-timeout,
9 pytest-asyncio,
10 pytest-django,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "channels";
18 version = "4.2.2";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "django";
25 repo = "channels";
26 tag = version;
27 hash = "sha256-Hx6ItDLt+QAy43SvyYVUY76Sva7+MYjcz0wJeXES/HQ=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [
33 asgiref
34 django
35 ];
36
37 optional-dependencies = {
38 daphne = [ daphne ];
39 };
40
41 nativeCheckInputs = [
42 async-timeout
43 pytest-asyncio
44 pytest-django
45 pytestCheckHook
46 ]
47 ++ lib.flatten (builtins.attrValues optional-dependencies);
48
49 pythonImportsCheck = [ "channels" ];
50
51 meta = with lib; {
52 description = "Brings event-driven capabilities to Django with a channel system";
53 homepage = "https://github.com/django/channels";
54 changelog = "https://github.com/django/channels/blob/${version}/CHANGELOG.txt";
55 license = licenses.bsd3;
56 maintainers = with maintainers; [ fab ];
57 };
58}