1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pythonOlder 5, typing-extensions 6, wsproto 7, toml 8, h2 9, priority 10, mock 11, poetry-core 12, pytest-asyncio 13, pytest-trio 14, pytestCheckHook 15}: 16 17buildPythonPackage rec { 18 pname = "Hypercorn"; 19 version = "0.14.3"; 20 disabled = pythonOlder "3.7"; 21 format = "pyproject"; 22 23 src = fetchFromGitHub { 24 owner = "pgjones"; 25 repo = pname; 26 rev = version; 27 hash = "sha256-ECREs8UwqTWUweUrwnUwpVotCII2v4Bz7ZCk3DSAd8I="; 28 }; 29 30 postPatch = '' 31 sed -i "/^addopts/d" pyproject.toml 32 ''; 33 34 nativeBuildInputs = [ 35 poetry-core 36 ]; 37 38 propagatedBuildInputs = [ wsproto toml h2 priority ] 39 ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; 40 41 checkInputs = [ 42 pytest-asyncio 43 pytest-trio 44 pytestCheckHook 45 ] ++ lib.optionals (pythonOlder "3.8") [ mock ]; 46 47 pythonImportsCheck = [ "hypercorn" ]; 48 49 meta = with lib; { 50 homepage = "https://github.com/pgjones/hypercorn"; 51 description = "The ASGI web server inspired by Gunicorn"; 52 license = licenses.mit; 53 maintainers = with maintainers; [ dgliwka ]; 54 }; 55}