1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 exceptiongroup,
7 h11,
8 h2,
9 priority,
10 wsproto,
11 poetry-core,
12 pytest-asyncio,
13 pytest-trio,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "hypercorn";
19 version = "0.16.0";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.11"; # missing taskgroup dependency
23
24 src = fetchFromGitHub {
25 owner = "pgjones";
26 repo = "Hypercorn";
27 rev = version;
28 hash = "sha256-pIUZCQmC3c6FiV0iMMwJGs9TMi6B/YM+vaSx//sAmKE=";
29 };
30
31 postPatch = ''
32 sed -i "/^addopts/d" pyproject.toml
33 '';
34
35 build-system = [ poetry-core ];
36
37 dependencies = [
38 exceptiongroup
39 h11
40 h2
41 priority
42 wsproto
43 ];
44
45 nativeCheckInputs = [
46 pytest-asyncio
47 pytest-trio
48 pytestCheckHook
49 ];
50
51 disabledTests = [
52 # https://github.com/pgjones/hypercorn/issues/217
53 "test_startup_failure"
54 ];
55
56 pythonImportsCheck = [ "hypercorn" ];
57
58 meta = with lib; {
59 homepage = "https://github.com/pgjones/hypercorn";
60 description = "ASGI web server inspired by Gunicorn";
61 mainProgram = "hypercorn";
62 license = licenses.mit;
63 maintainers = with maintainers; [ dgliwka ];
64 };
65}