28 , doCheck ? !stdenv.isDarwin # on Darwin, tests fail but pkg still works
39 buildPythonPackage rec {
44 disabled = pythonOlder "3.7";
46 src = fetchFromGitHub {
49 rev = "refs/tags/v${version}";
50 hash = "sha256-TizjibqoLNMX0m5oPyncKgFnltXOLZUIPSzVIeKU25w=";
58 propagatedBuildInputs = [
71 passthru.optional-dependencies = {
87 ] ++ passthru.optional-dependencies.http3;
92 # Some tests depends on sanic on PATH
94 PYTHONPATH=$PWD:$PYTHONPATH
96 # needed for relative paths for some packages
98 '' + lib.optionalString stdenv.isDarwin ''
99 # OSError: [Errno 24] Too many open files
103 # uvloop usage is buggy
104 #SANIC_NO_UVLOOP = true;
107 "--asyncio-mode=auto"
114 # Server mode mismatch (debug vs production)
117 "test_keep_alive_client_timeout"
118 "test_keep_alive_server_timeout"
120 # sanic.exceptions.SanicException: Cannot setup Sanic Simple Server without a path to a directory
121 "test_load_app_simple"
122 # create defunct python processes
124 "test_reloader_live_with_dir"
125 "test_reload_listeners"
126 # crash the python interpreter
127 "test_host_port_localhost"
130 # NoneType object is not subscriptable
131 "test_serve_app_implicit"
132 # AssertionError: assert [] == ['Restarting a process', 'Begin restart termination', 'Starting a process']
133 "test_default_reload_shutdown_order"
136 # HTTP 500 with Websocket subprotocols
137 "test_websocket_route_with_subprotocols"
138 # Socket closes early
139 "test_no_exceptions_when_cancel_pending_request"
140 ] ++ lib.optionals (pythonAtLeast "3.12") [
141 # AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
142 "test_ws_frame_put_message_into_queue"
145 disabledTestPaths = [
146 # We are not interested in benchmarks
148 # We are also not interested in typing
149 "typing/test_typing.py"
150 # unable to create async loop
154 "test_multiprocessing.py"
157 # avoid usage of nixpkgs-review in darwin since tests will compete usage
158 # for the same local port
159 __darwinAllowLocalNetworking = true;
161 pythonImportsCheck = [ "sanic" ];
164 description = "Web server and web framework";
165 mainProgram = "sanic";
166 homepage = "https://github.com/sanic-org/sanic/";
167 changelog = "https://github.com/sanic-org/sanic/releases/tag/v${version}";
168 license = licenses.mit;
169 maintainers = with maintainers; [ AluisioASG ];