Skip to content

Commit

Permalink
fixup! python3Packages.sanic: 24.6.0 -> 24.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mweinelt committed Jan 24, 2025
1 parent a723f45 commit 41bab14
Showing 1 changed file with 26 additions and 66 deletions.
92 changes: 26 additions & 66 deletions pkgs/development/python-modules/sanic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
aioquic,
beautifulsoup4,
buildPythonPackage,
doCheck ? !stdenv.hostPlatform.isDarwin, # on Darwin, tests fail but pkg still works
cacert,
fetchFromGitHub,
gunicorn,
html5tagger,
httptools,
multidict,
pytest-asyncio,
pytestCheckHook,
pythonAtLeast,
pythonOlder,
sanic-routing,
sanic-testing,
Expand Down Expand Up @@ -71,77 +70,38 @@ buildPythonPackage rec {
uvicorn
] ++ optional-dependencies.http3;

inherit doCheck;

preCheck =
''
# Some tests depends on sanic on PATH
PATH="$out/bin:$PATH"
PYTHONPATH=$PWD:$PYTHONPATH
# needed for relative paths for some packages
cd tests
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# OSError: [Errno 24] Too many open files
ulimit -n 1024
'';

# uvloop usage is buggy
#SANIC_NO_UVLOOP = true;

pytestFlagsArray = [
"--asyncio-mode=auto"
"-vvv"
doCheck = !stdenv.hostPlatform.isDarwin;

preCheck = ''
# Some tests depends on sanic on PATH
PATH="$out/bin:$PATH"
PYTHONPATH=$PWD:$PYTHONPATH
# httpx since 0.28.0+ depends on SSL_CERT_FILE
SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
# needed for relative paths for some packages
cd tests
'';

disabledTests = [
# EOFError: Ran out of input
"test_server_run_with_repl"
# InvalidStatusCode: server rejected WebSocket connection: HTTP 400
"test_websocket_route_with_subprotocols"
# nic.exceptions.SanicException: Cannot setup Sanic Simple Server without a path to a directory
"test_load_app_simple"
# ModuleNotFoundError: No module named '/build/source/tests/tests/static'
"test_input_is_dir"
# Racy, e.g. Address already in use
"test_logger_vhosts"
];

disabledTests =
[
# Require networking
"test_full_message"
# Server mode mismatch (debug vs production)
"test_num_workers"
# Racy tests
"test_custom_cert_loader"
"test_keep_alive_client_timeout"
"test_keep_alive_server_timeout"
"test_logger_vhosts"
"test_ssl_in_multiprocess_mode"
"test_zero_downtime"
# sanic.exceptions.SanicException: Cannot setup Sanic Simple Server without a path to a directory
"test_load_app_simple"
# Tests create defunct Python processes
"test_reloader_live"
"test_reloader_live_with_dir"
"test_reload_listeners"
# Tests crash the Python interpreter
"test_host_port_localhost"
"test_host_port"
"test_server_run"
# NoneType object is not subscriptable
"test_serve_app_implicit"
# AssertionError: assert [] == ['Restarting a process', 'Begin restart termination', 'Starting a process']
"test_default_reload_shutdown_order"
# App not found.
"test_input_is_dir"
# HTTP 500 with Websocket subprotocols
"test_websocket_route_with_subprotocols"
# Socket closes early
"test_no_exceptions_when_cancel_pending_request"
]
++ lib.optionals (pythonAtLeast "3.12") [
# AttributeError: 'has_calls' is not a valid assertion. Use a spec for the mock if 'has_calls' is meant to be an attribute.
"test_ws_frame_put_message_into_queue"
];

disabledTestPaths = [
# We are not interested in benchmarks
"benchmark/"
# We are also not interested in typing
"typing/test_typing.py"
# unable to create async loop
"test_app.py"
"test_asgi.py"
# occasionally hangs
"test_multiprocessing.py"
];
Expand Down

0 comments on commit 41bab14

Please sign in to comment.