2021-06-19 19:53:54 +01:00
|
|
|
{ lib
|
2019-07-25 21:33:06 +01:00
|
|
|
, buildPythonPackage
|
2021-06-19 19:53:54 +01:00
|
|
|
, callPackage
|
2019-09-16 23:07:28 +01:00
|
|
|
, fetchFromGitHub
|
2021-06-19 19:53:54 +01:00
|
|
|
, asgiref
|
2019-07-25 21:33:06 +01:00
|
|
|
, click
|
2021-06-19 19:53:54 +01:00
|
|
|
, colorama
|
2019-07-25 21:33:06 +01:00
|
|
|
, h11
|
|
|
|
, httptools
|
2021-06-19 19:53:54 +01:00
|
|
|
, python-dotenv
|
2021-01-06 18:23:56 +00:00
|
|
|
, pyyaml
|
2019-09-16 23:07:28 +01:00
|
|
|
, requests
|
2021-01-06 18:23:56 +00:00
|
|
|
, typing-extensions
|
2021-06-19 19:53:54 +01:00
|
|
|
, uvloop
|
|
|
|
, watchgod
|
|
|
|
, websockets
|
|
|
|
, wsproto
|
2021-01-06 18:23:56 +00:00
|
|
|
, pythonOlder
|
2019-07-25 21:33:06 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvicorn";
|
2021-06-19 19:53:54 +01:00
|
|
|
version = "0.14.0";
|
|
|
|
disabled = pythonOlder "3.6";
|
2019-07-25 21:33:06 +01:00
|
|
|
|
2019-09-16 23:07:28 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-06-19 19:53:54 +01:00
|
|
|
sha256 = "164x92k3rs47ihkmwq5av396576dxp4rzv6557pwgc1ign2ikqy1";
|
2019-07-25 21:33:06 +01:00
|
|
|
};
|
|
|
|
|
2021-06-19 19:53:54 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"testsout"
|
|
|
|
];
|
|
|
|
|
2019-07-25 21:33:06 +01:00
|
|
|
propagatedBuildInputs = [
|
2021-06-19 19:53:54 +01:00
|
|
|
asgiref
|
2019-07-25 21:33:06 +01:00
|
|
|
click
|
2021-06-19 19:53:54 +01:00
|
|
|
colorama
|
2019-07-25 21:33:06 +01:00
|
|
|
h11
|
|
|
|
httptools
|
2021-06-19 19:53:54 +01:00
|
|
|
python-dotenv
|
|
|
|
pyyaml
|
2019-07-25 21:33:06 +01:00
|
|
|
uvloop
|
2021-06-19 19:53:54 +01:00
|
|
|
watchgod
|
2019-07-25 21:33:06 +01:00
|
|
|
websockets
|
|
|
|
wsproto
|
2021-01-06 18:23:56 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
2019-07-25 21:33:06 +01:00
|
|
|
];
|
|
|
|
|
2021-06-19 19:53:54 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir $testsout
|
|
|
|
cp -R tests $testsout/tests
|
|
|
|
'';
|
2020-11-30 12:48:15 +00:00
|
|
|
|
2021-06-19 19:53:54 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"uvicorn"
|
2021-01-06 18:23:56 +00:00
|
|
|
];
|
|
|
|
|
2021-06-19 19:53:54 +01:00
|
|
|
# check in passthru.tests.pytest to escape infinite recursion with httpx/httpcore
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
pytest = callPackage ./tests.nix { };
|
|
|
|
};
|
2019-09-09 19:15:41 +01:00
|
|
|
|
2021-01-06 18:23:56 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|