Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 119 lines 2.5 kB view raw
1{ 2 lib, 3 stdenv, 4 aiofiles, 5 aioquic, 6 beautifulsoup4, 7 buildPythonPackage, 8 fetchFromGitHub, 9 gunicorn, 10 html5tagger, 11 httptools, 12 multidict, 13 pytest-asyncio, 14 pytestCheckHook, 15 pythonOlder, 16 sanic-routing, 17 sanic-testing, 18 setuptools, 19 tracerite, 20 typing-extensions, 21 ujson, 22 uvicorn, 23 uvloop, 24 websockets, 25}: 26 27buildPythonPackage rec { 28 pname = "sanic"; 29 version = "25.3.0"; 30 pyproject = true; 31 32 disabled = pythonOlder "3.7"; 33 34 src = fetchFromGitHub { 35 owner = "sanic-org"; 36 repo = "sanic"; 37 tag = "v${version}"; 38 hash = "sha256-tucLXWYPpALQrPYf+aiovKHYf2iouu6jezvNdukEu9w="; 39 }; 40 41 build-system = [ setuptools ]; 42 43 dependencies = [ 44 aiofiles 45 httptools 46 html5tagger 47 multidict 48 sanic-routing 49 tracerite 50 typing-extensions 51 ujson 52 uvloop 53 websockets 54 ]; 55 56 optional-dependencies = { 57 ext = [ 58 # TODO: sanic-ext 59 ]; 60 http3 = [ aioquic ]; 61 }; 62 63 nativeCheckInputs = [ 64 beautifulsoup4 65 gunicorn 66 pytest-asyncio 67 pytestCheckHook 68 sanic-testing 69 uvicorn 70 ] ++ optional-dependencies.http3; 71 72 doCheck = !stdenv.hostPlatform.isDarwin; 73 74 preCheck = '' 75 # Some tests depends on sanic on PATH 76 PATH="$out/bin:$PATH" 77 PYTHONPATH=$PWD:$PYTHONPATH 78 79 # needed for relative paths for some packages 80 cd tests 81 ''; 82 83 disabledTests = [ 84 # EOFError: Ran out of input 85 "test_server_run_with_repl" 86 # InvalidStatusCode: server rejected WebSocket connection: HTTP 400 87 "test_websocket_route_with_subprotocols" 88 # nic.exceptions.SanicException: Cannot setup Sanic Simple Server without a path to a directory 89 "test_load_app_simple" 90 # ModuleNotFoundError: No module named '/build/source/tests/tests/static' 91 "test_input_is_dir" 92 # Racy, e.g. Address already in use 93 "test_logger_vhosts" 94 ]; 95 96 disabledTestPaths = [ 97 # We are not interested in benchmarks 98 "benchmark/" 99 # We are also not interested in typing 100 "typing/test_typing.py" 101 # occasionally hangs 102 "test_multiprocessing.py" 103 ]; 104 105 # Avoid usage of nixpkgs-review in darwin since tests will compete usage 106 # for the same local port 107 __darwinAllowLocalNetworking = true; 108 109 pythonImportsCheck = [ "sanic" ]; 110 111 meta = with lib; { 112 description = "Web server and web framework"; 113 homepage = "https://github.com/sanic-org/sanic/"; 114 changelog = "https://github.com/sanic-org/sanic/releases/tag/${src.tag}"; 115 license = licenses.mit; 116 maintainers = with maintainers; [ p0lyw0lf ]; 117 mainProgram = "sanic"; 118 }; 119}