@@ -1,4 +1,5 @@
11{ lib
2+, stdenv
23, aiofiles
34, beautifulsoup4
45, buildPythonPackage
@@ -10,7 +11,6 @@
1011, multidict
1112, pytest-asyncio
1213, pytest-benchmark
13−, pytest-sanic
1414, pytest-sugar
1515, pytestCheckHook
1616, sanic-routing
@@ -23,28 +23,19 @@
2323
2424buildPythonPackage rec {
2525 pname = "sanic";
26− version = "21.3.4";
26+ version = "21.9.1";
2727
2828 src = fetchFromGitHub {
2929 owner = "sanic-org";
3030 repo = pname;
3131 rev = "v${version}";
32− sha256 = "0vldlic8gqcf56fqb31igycqf11syd9csk66v34w6dim54lcny2b";
32+ sha256 = "sha256-TRrJr/L8AXLAARPjhBi2FxNh+jvxxdeMN24cT1njmqY=";
3333 };
3434
35− patches = [
36− # Allow later websockets release, https://github.com/sanic-org/sanic/pull/2154
37− (fetchpatch {
38− name = "later-websockets.patch";
39− url = "https://github.com/sanic-org/sanic/commit/5fb820b5c1ce395e86a1ee11996790c65ec7bc65.patch";
40− sha256 = "1glvq23pf1sxqjnrz0w8rr7nsnyz82k1479b3rm8szfkjg9q5d1w";
41− })
42− ];
43−
4435 postPatch = ''
4536 # Loosen dependency requirements.
4637 substituteInPlace setup.py \
47− --replace '"pytest==5.2.1"' '"pytest"' \
38+ --replace '"pytest==6.2.5"' '"pytest"' \
4839 --replace '"gunicorn==20.0.4"' '"gunicorn"' \
4940 --replace '"pytest-sanic",' "" \
5041 # Patch a request headers test to allow brotli encoding
@@ -68,7 +59,6 @@ buildPythonPackage rec {
6859 gunicorn
6960 pytest-asyncio
7061 pytest-benchmark
71− pytest-sanic
7262 pytest-sugar
7363 pytestCheckHook
7464 sanic-testing
@@ -77,6 +67,11 @@ buildPythonPackage rec {
7767
7868 inherit doCheck;
7969
70+ preCheck = ''
71+ # Some tests depends on executables on PATH
72+ PATH="$out/bin:${gunicorn}/bin:$PATH"
73+ '';
74+
8075 disabledTests = [
8176 # Tests are flaky
8277 "test_keep_alive_client_timeout"
@@ -84,8 +79,18 @@ buildPythonPackage rec {
8479 "test_check_timeouts_response_timeout"
8580 "test_reloader_live"
8681 "test_zero_downtime"
82+ # Not working from 21.9.1
83+ "test_create_server_main"
84+ "test_create_server_main_convenience"
85+ "test_debug"
86+ "test_auto_reload"
87+ ] ++ lib.optionals stdenv.isDarwin [
88+ # https://github.com/sanic-org/sanic/issues/2298
89+ "test_no_exceptions_when_cancel_pending_request"
8790 ];
8891
92+ # avoid usage of nixpkgs-review in darwin since tests will compete usage
93+ # for the same local port
8994 __darwinAllowLocalNetworking = true;
9095
9196 pythonImportsCheck = [ "sanic" ];