nixpkgs/pkgs/development/python-modules/uvicorn/default.nix

77 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
2019-07-25 21:33:06 +01:00
, buildPythonPackage
, callPackage
, fetchFromGitHub
, asgiref
2019-07-25 21:33:06 +01:00
, click
, colorama
2019-07-25 21:33:06 +01:00
, h11
, httptools
, python-dotenv
, pyyaml
, requests
, typing-extensions
, uvloop
, watchgod
, websockets
, wsproto
, pythonOlder
2019-07-25 21:33:06 +01:00
}:
buildPythonPackage rec {
pname = "uvicorn";
version = "0.14.0";
disabled = pythonOlder "3.6";
2019-07-25 21:33:06 +01:00
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "164x92k3rs47ihkmwq5av396576dxp4rzv6557pwgc1ign2ikqy1";
2019-07-25 21:33:06 +01:00
};
outputs = [
"out"
"testsout"
];
2019-07-25 21:33:06 +01:00
propagatedBuildInputs = [
asgiref
2019-07-25 21:33:06 +01:00
click
colorama
2019-07-25 21:33:06 +01:00
h11
httptools
python-dotenv
pyyaml
2019-07-25 21:33:06 +01:00
uvloop
watchgod
2019-07-25 21:33:06 +01:00
websockets
wsproto
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
2019-07-25 21:33:06 +01:00
];
postInstall = ''
mkdir $testsout
cp -R tests $testsout/tests
'';
pythonImportsCheck = [
"uvicorn"
];
# check in passthru.tests.pytest to escape infinite recursion with httpx/httpcore
doCheck = false;
passthru.tests = {
pytest = callPackage ./tests.nix { };
};
meta = with lib; {
homepage = "https://www.uvicorn.org/";
2019-07-25 21:33:06 +01:00
description = "The lightning-fast ASGI server";
license = licenses.bsd3;
maintainers = with maintainers; [ wd15 ];
};
}