Merge pull request #144672 from thiagokokada/zhf-sanic

sanic: 21.3.4 -> 21.9.1,   sanic-routing: 0.6.2 -> 0.7.2
This commit is contained in:
Thiago Kenji Okada 2021-11-04 22:36:41 -03:00 committed by GitHub
commit 5abb42f395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 16 deletions

View File

@ -47,5 +47,6 @@ buildPythonPackage rec {
homepage = "https://github.com/yunstanford/pytest-sanic/"; homepage = "https://github.com/yunstanford/pytest-sanic/";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ costrouc ]; maintainers = with maintainers; [ costrouc ];
broken = true; # 2021-11-04
}; };
} }

View File

@ -7,13 +7,13 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "sanic-routing"; pname = "sanic-routing";
version = "0.6.2"; version = "0.7.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "sanic-org"; owner = "sanic-org";
repo = "sanic-routing"; repo = "sanic-routing";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-ZMl8PB9E401pUfUJ4tW7nBx1TgPQQtx9erVni3zP+lo="; hash = "sha256-MN6A8CtDVxj34eehr3UIwCT09VOfcruVX+/iImr1MgY=";
}; };
checkInputs = [ pytestCheckHook pytest-asyncio ]; checkInputs = [ pytestCheckHook pytest-asyncio ];

View File

@ -1,4 +1,5 @@
{ lib { lib
, stdenv
, aiofiles , aiofiles
, beautifulsoup4 , beautifulsoup4
, buildPythonPackage , buildPythonPackage
@ -10,7 +11,6 @@
, multidict , multidict
, pytest-asyncio , pytest-asyncio
, pytest-benchmark , pytest-benchmark
, pytest-sanic
, pytest-sugar , pytest-sugar
, pytestCheckHook , pytestCheckHook
, sanic-routing , sanic-routing
@ -23,28 +23,19 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "sanic"; pname = "sanic";
version = "21.3.4"; version = "21.9.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "sanic-org"; owner = "sanic-org";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "0vldlic8gqcf56fqb31igycqf11syd9csk66v34w6dim54lcny2b"; sha256 = "sha256-TRrJr/L8AXLAARPjhBi2FxNh+jvxxdeMN24cT1njmqY=";
}; };
patches = [
# Allow later websockets release, https://github.com/sanic-org/sanic/pull/2154
(fetchpatch {
name = "later-websockets.patch";
url = "https://github.com/sanic-org/sanic/commit/5fb820b5c1ce395e86a1ee11996790c65ec7bc65.patch";
sha256 = "1glvq23pf1sxqjnrz0w8rr7nsnyz82k1479b3rm8szfkjg9q5d1w";
})
];
postPatch = '' postPatch = ''
# Loosen dependency requirements. # Loosen dependency requirements.
substituteInPlace setup.py \ substituteInPlace setup.py \
--replace '"pytest==5.2.1"' '"pytest"' \ --replace '"pytest==6.2.5"' '"pytest"' \
--replace '"gunicorn==20.0.4"' '"gunicorn"' \ --replace '"gunicorn==20.0.4"' '"gunicorn"' \
--replace '"pytest-sanic",' "" \ --replace '"pytest-sanic",' "" \
# Patch a request headers test to allow brotli encoding # Patch a request headers test to allow brotli encoding
@ -68,7 +59,6 @@ buildPythonPackage rec {
gunicorn gunicorn
pytest-asyncio pytest-asyncio
pytest-benchmark pytest-benchmark
pytest-sanic
pytest-sugar pytest-sugar
pytestCheckHook pytestCheckHook
sanic-testing sanic-testing
@ -77,6 +67,11 @@ buildPythonPackage rec {
inherit doCheck; inherit doCheck;
preCheck = ''
# Some tests depends on executables on PATH
PATH="$out/bin:${gunicorn}/bin:$PATH"
'';
disabledTests = [ disabledTests = [
# Tests are flaky # Tests are flaky
"test_keep_alive_client_timeout" "test_keep_alive_client_timeout"
@ -84,8 +79,18 @@ buildPythonPackage rec {
"test_check_timeouts_response_timeout" "test_check_timeouts_response_timeout"
"test_reloader_live" "test_reloader_live"
"test_zero_downtime" "test_zero_downtime"
# Not working from 21.9.1
"test_create_server_main"
"test_create_server_main_convenience"
"test_debug"
"test_auto_reload"
] ++ lib.optionals stdenv.isDarwin [
# https://github.com/sanic-org/sanic/issues/2298
"test_no_exceptions_when_cancel_pending_request"
]; ];
# avoid usage of nixpkgs-review in darwin since tests will compete usage
# for the same local port
__darwinAllowLocalNetworking = true; __darwinAllowLocalNetworking = true;
pythonImportsCheck = [ "sanic" ]; pythonImportsCheck = [ "sanic" ];