lol

python3Packages.uvicorn: 0.13.2 -> 0.14.0

Separates tests out into a separate attribute to resolve infinite
recursion problems with httpx/httpcore.

+74 -30
+34 -30
pkgs/development/python-modules/uvicorn/default.nix
··· 1 - { stdenv 2 - , lib 1 + { lib 3 2 , buildPythonPackage 3 + , callPackage 4 4 , fetchFromGitHub 5 + , asgiref 5 6 , click 7 + , colorama 6 8 , h11 7 9 , httptools 8 - , uvloop 9 - , websockets 10 - , wsproto 11 - , pytestCheckHook 12 - , pytest-mock 10 + , python-dotenv 13 11 , pyyaml 14 12 , requests 15 - , trustme 16 13 , typing-extensions 17 - , isPy27 14 + , uvloop 15 + , watchgod 16 + , websockets 17 + , wsproto 18 18 , pythonOlder 19 19 }: 20 20 21 21 buildPythonPackage rec { 22 22 pname = "uvicorn"; 23 - version = "0.13.2"; 24 - disabled = isPy27; 23 + version = "0.14.0"; 24 + disabled = pythonOlder "3.6"; 25 25 26 26 src = fetchFromGitHub { 27 27 owner = "encode"; 28 28 repo = pname; 29 29 rev = version; 30 - sha256 = "04zgmp9z46k72ay6cz7plga6d3w3a6x41anabm7ramp7jdqf6na9"; 30 + sha256 = "164x92k3rs47ihkmwq5av396576dxp4rzv6557pwgc1ign2ikqy1"; 31 31 }; 32 32 33 + outputs = [ 34 + "out" 35 + "testsout" 36 + ]; 37 + 33 38 propagatedBuildInputs = [ 39 + asgiref 34 40 click 41 + colorama 35 42 h11 36 43 httptools 44 + python-dotenv 45 + pyyaml 37 46 uvloop 47 + watchgod 38 48 websockets 39 49 wsproto 40 50 ] ++ lib.optionals (pythonOlder "3.8") [ 41 51 typing-extensions 42 52 ]; 43 53 44 - checkInputs = [ 45 - pytestCheckHook 46 - pytest-mock 47 - pyyaml 48 - requests 49 - trustme 50 - ]; 51 - 52 - doCheck = !stdenv.isDarwin; 53 - 54 - __darwinAllowLocalNetworking = true; 54 + postInstall = '' 55 + mkdir $testsout 56 + cp -R tests $testsout/tests 57 + ''; 55 58 56 - pytestFlagsArray = [ 57 - # watchgod required the watchgod package, which isn't available in nixpkgs 58 - "--ignore=tests/supervisors/test_reload.py" 59 + pythonImportsCheck = [ 60 + "uvicorn" 59 61 ]; 60 62 61 - disabledTests = [ 62 - "test_supported_upgrade_request" 63 - "test_invalid_upgrade" 64 - ]; 63 + # check in passthru.tests.pytest to escape infinite recursion with httpx/httpcore 64 + doCheck = false; 65 + 66 + passthru.tests = { 67 + pytest = callPackage ./tests.nix { }; 68 + }; 65 69 66 70 meta = with lib; { 67 71 homepage = "https://www.uvicorn.org/";
+40
pkgs/development/python-modules/uvicorn/tests.nix
··· 1 + { stdenv 2 + , buildPythonPackage 3 + , uvicorn 4 + , httpx 5 + , pytest-asyncio 6 + , pytestCheckHook 7 + , pytest-mock 8 + , requests 9 + , trustme 10 + }: 11 + 12 + buildPythonPackage rec { 13 + pname = "uvicorn-tests"; 14 + inherit (uvicorn) version; 15 + 16 + src = uvicorn.testsout; 17 + 18 + dontBuild = true; 19 + dontInstall = true; 20 + 21 + checkInputs = [ 22 + uvicorn 23 + httpx 24 + pytestCheckHook 25 + pytest-asyncio 26 + pytest-mock 27 + requests 28 + trustme 29 + ]; 30 + 31 + doCheck = !stdenv.isDarwin; 32 + 33 + __darwinAllowLocalNetworking = true; 34 + 35 + disabledTests = [ 36 + "test_supported_upgrade_request" 37 + "test_invalid_upgrade" 38 + ]; 39 + } 40 +