nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, async-timeout
4, buildPythonPackage
5, fetchFromGitHub
6, pytest-asyncio
7, pytestCheckHook
8, pythonOlder
9, fetchpatch
10}:
11
12buildPythonPackage rec {
13 version = "3.5.0";
14 pname = "asgiref";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "django";
21 repo = pname;
22 rev = version;
23 sha256 = "sha256-eWDsd8iWK1C/X3t/fKAM1i4hyTM/daGTd8CDSgDTL/U=";
24 };
25
26 patches = [
27 (fetchpatch {
28 name = "remove-sock-nonblock-in-tests.patch";
29 url = "https://github.com/django/asgiref/commit/d451a724c93043b623e83e7f86743bbcd9a05c45.patch";
30 sha256 = "0whdsn5isln4dqbqqngvsy4yxgaqgpnziz0cndj1zdxim8cdicj7";
31 })
32 ];
33
34 propagatedBuildInputs = [
35 async-timeout
36 ];
37
38 checkInputs = [
39 pytestCheckHook
40 pytest-asyncio
41 ];
42
43 disabledTests = lib.optionals stdenv.isDarwin [
44 "test_multiprocessing"
45 ];
46
47 pythonImportsCheck = [ "asgiref" ];
48
49 meta = with lib; {
50 description = "Reference ASGI adapters and channel layers";
51 homepage = "https://github.com/django/asgiref";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ SuperSandro2000 ];
54 };
55}