2020-11-30 12:48:15 +00:00
|
|
|
{ stdenv
|
2021-01-06 18:23:56 +00:00
|
|
|
, lib
|
2019-07-25 20:33:06 +00:00
|
|
|
, buildPythonPackage
|
2019-09-16 22:07:28 +00:00
|
|
|
, fetchFromGitHub
|
2019-07-25 20:33:06 +00:00
|
|
|
, click
|
|
|
|
, h11
|
|
|
|
, httptools
|
|
|
|
, uvloop
|
|
|
|
, websockets
|
|
|
|
, wsproto
|
2021-01-06 18:23:56 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-mock
|
|
|
|
, pyyaml
|
2019-09-16 22:07:28 +00:00
|
|
|
, requests
|
2021-01-06 18:23:56 +00:00
|
|
|
, trustme
|
|
|
|
, typing-extensions
|
2019-07-25 20:33:06 +00:00
|
|
|
, isPy27
|
2021-01-06 18:23:56 +00:00
|
|
|
, pythonOlder
|
2019-07-25 20:33:06 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvicorn";
|
2021-01-06 18:23:56 +00:00
|
|
|
version = "0.13.2";
|
2019-07-25 20:33:06 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2019-09-16 22:07:28 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-01-06 18:23:56 +00:00
|
|
|
sha256 = "04zgmp9z46k72ay6cz7plga6d3w3a6x41anabm7ramp7jdqf6na9";
|
2019-07-25 20:33:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
h11
|
|
|
|
httptools
|
|
|
|
uvloop
|
|
|
|
websockets
|
|
|
|
wsproto
|
2021-01-06 18:23:56 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
2019-07-25 20:33:06 +00:00
|
|
|
];
|
|
|
|
|
2021-01-06 18:23:56 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
trustme
|
|
|
|
];
|
2020-11-30 12:48:15 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-11-16 22:40:53 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2021-01-06 18:23:56 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# watchgod required the watchgod package, which isn't available in nixpkgs
|
|
|
|
"--ignore=tests/supervisors/test_reload.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_supported_upgrade_request"
|
|
|
|
"test_invalid_upgrade"
|
|
|
|
];
|
2019-09-09 18:15:41 +00:00
|
|
|
|
2021-01-06 18:23:56 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.uvicorn.org/";
|
2019-07-25 20:33:06 +00:00
|
|
|
description = "The lightning-fast ASGI server";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|