Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at domenkozar-patch-1 143 lines 3.1 kB view raw
1{ lib 2, stdenv 3, aiofiles 4, beautifulsoup4 5, buildPythonPackage 6, doCheck ? true 7, fetchFromGitHub 8, gunicorn 9, httptools 10, multidict 11, pytest-asyncio 12, pytest-benchmark 13, pytest-sugar 14, pytestCheckHook 15, pythonOlder 16, pythonAtLeast 17, sanic-routing 18, sanic-testing 19, ujson 20, uvicorn 21, uvloop 22, websockets 23, aioquic 24}: 25 26buildPythonPackage rec { 27 pname = "sanic"; 28 version = "22.9.1"; 29 format = "setuptools"; 30 31 disabled = pythonOlder "3.7"; 32 33 src = fetchFromGitHub { 34 owner = "sanic-org"; 35 repo = pname; 36 rev = "refs/tags/v${version}"; 37 hash = "sha256-KbcHnAdr59hk7W36BiTb/hD74ktj/DGzq1vcuZ/lGfQ="; 38 }; 39 40 propagatedBuildInputs = [ 41 aiofiles 42 aioquic 43 httptools 44 multidict 45 sanic-routing 46 ujson 47 uvloop 48 websockets 49 ]; 50 51 checkInputs = [ 52 beautifulsoup4 53 gunicorn 54 pytest-asyncio 55 pytestCheckHook 56 sanic-testing 57 uvicorn 58 ]; 59 60 inherit doCheck; 61 62 preCheck = '' 63 # Some tests depends on sanic on PATH 64 PATH="$out/bin:$PATH" 65 PYTHONPATH=$PWD:$PYTHONPATH 66 67 # needed for relative paths for some packages 68 cd tests 69 '' + lib.optionalString stdenv.isDarwin '' 70 # OSError: [Errno 24] Too many open files 71 ulimit -n 1024 72 ''; 73 74 # uvloop usage is buggy 75 #SANIC_NO_UVLOOP = true; 76 77 pytestFlagsArray = [ 78 "--asyncio-mode=auto" 79 ]; 80 81 disabledTests = [ 82 # Require networking 83 "test_full_message" 84 # Fails to parse cmdline arguments 85 "test_dev" 86 "test_auto_reload" 87 "test_host_port_ipv6_loopback" 88 "test_num_workers" 89 "test_debug" 90 "test_access_logs" 91 "test_noisy_exceptions" 92 # OSError: foo 93 "test_bad_headers" 94 "test_create_server_trigger_events" 95 "test_json_body_requests" 96 "test_missing_startup_raises_exception" 97 "test_no_body_requests" 98 "test_oserror_warning" 99 "test_running_multiple_offset_warning" 100 "test_streaming_body_requests" 101 "test_trigger_before_events_create_server" 102 "test_keep_alive_connection_context" 103 # Racy tests 104 "test_keep_alive_client_timeout" 105 "test_keep_alive_server_timeout" 106 "test_zero_downtime" 107 # TLS tests 108 "test_missing_sni" 109 "test_no_matching_cert" 110 "test_wildcards" 111 # They thtow execptions 112 "test_load_app_simple" 113 "worker/test_loader.py" 114 # broke with ujson 5.4 upgrade 115 # https://github.com/sanic-org/sanic/pull/2504 116 "test_json_response_json" 117 ]; 118 119 disabledTestPaths = [ 120 # We are not interested in benchmarks 121 "benchmark/" 122 # unable to create async loop 123 "test_app.py" 124 "test_asgi.py" 125 # occasionally hangs 126 "test_multiprocessing.py" 127 ]; 128 129 # avoid usage of nixpkgs-review in darwin since tests will compete usage 130 # for the same local port 131 __darwinAllowLocalNetworking = true; 132 133 pythonImportsCheck = [ "sanic" ]; 134 135 meta = with lib; { 136 broken = stdenv.isDarwin; 137 description = "Web server and web framework"; 138 homepage = "https://github.com/sanic-org/sanic/"; 139 changelog = "https://github.com/sanic-org/sanic/releases/tag/v${version}"; 140 license = licenses.mit; 141 maintainers = with maintainers; [ costrouc AluisioASG ]; 142 }; 143}