nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 76 lines 1.3 kB view raw
1{ lib 2, buildPythonPackage 3, callPackage 4, fetchFromGitHub 5, asgiref 6, click 7, colorama 8, h11 9, httptools 10, python-dotenv 11, pyyaml 12, typing-extensions 13, uvloop 14, watchgod 15, websockets 16, wsproto 17, pythonOlder 18}: 19 20buildPythonPackage rec { 21 pname = "uvicorn"; 22 version = "0.17.6"; 23 disabled = pythonOlder "3.6"; 24 25 src = fetchFromGitHub { 26 owner = "encode"; 27 repo = pname; 28 rev = version; 29 hash = "sha256-iJlAU7zZl9X3FcQlJoJ7KlETZOx6WsE9FcpCK4Cm/Fo="; 30 }; 31 32 outputs = [ 33 "out" 34 "testsout" 35 ]; 36 37 propagatedBuildInputs = [ 38 asgiref 39 click 40 colorama 41 h11 42 httptools 43 python-dotenv 44 pyyaml 45 uvloop 46 watchgod 47 websockets 48 wsproto 49 ] ++ lib.optionals (pythonOlder "3.8") [ 50 typing-extensions 51 ]; 52 53 postInstall = '' 54 mkdir $testsout 55 cp -R tests $testsout/tests 56 ''; 57 58 pythonImportsCheck = [ 59 "uvicorn" 60 ]; 61 62 # check in passthru.tests.pytest to escape infinite recursion with httpx/httpcore 63 doCheck = false; 64 65 passthru.tests = { 66 pytest = callPackage ./tests.nix { }; 67 }; 68 69 meta = with lib; { 70 homepage = "https://www.uvicorn.org/"; 71 changelog = "https://github.com/encode/uvicorn/blob/${src.rev}/CHANGELOG.md"; 72 description = "The lightning-fast ASGI server"; 73 license = licenses.bsd3; 74 maintainers = with maintainers; [ wd15 ]; 75 }; 76}