1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, httpx 5, sanic 6, websockets 7, callPackage 8}: 9 10buildPythonPackage rec { 11 pname = "sanic-testing"; 12 version = "22.3.1"; 13 14 src = fetchFromGitHub { 15 owner = "sanic-org"; 16 repo = "sanic-testing"; 17 rev = "refs/tags/v${version}"; 18 sha256 = "sha256-6aJyc5B9e65RPG3FwXAoQByVNdrLAWTEu2/Dqf9hf+g="; 19 }; 20 21 outputs = [ 22 "out" 23 "testsout" 24 ]; 25 26 postPatch = '' 27 sed -i 's/httpx>=.*"/httpx"/' setup.py 28 ''; 29 30 propagatedBuildInputs = [ 31 httpx 32 sanic 33 websockets 34 ]; 35 36 postInstall = '' 37 mkdir $testsout 38 cp -R tests $testsout/tests 39 ''; 40 41 # check in passthru.tests.pytest to escape infinite recursion with sanic 42 doCheck = false; 43 doInstallCheck = false; 44 45 passthru.tests = { 46 pytest = callPackage ./tests.nix { }; 47 }; 48 49 meta = with lib; { 50 description = "Core testing clients for the Sanic web framework"; 51 homepage = "https://github.com/sanic-org/sanic-testing"; 52 license = licenses.mit; 53 maintainers = with maintainers; [ AluisioASG ]; 54 }; 55}