2020-11-30 12:48:15 +00:00
|
|
|
{ stdenv
|
2019-07-25 21:33:06 +01:00
|
|
|
, buildPythonPackage
|
2019-09-16 23:07:28 +01:00
|
|
|
, fetchFromGitHub
|
2019-07-25 21:33:06 +01:00
|
|
|
, click
|
|
|
|
, h11
|
|
|
|
, httptools
|
|
|
|
, uvloop
|
|
|
|
, websockets
|
|
|
|
, wsproto
|
2019-09-16 23:07:28 +01:00
|
|
|
, pytest
|
|
|
|
, requests
|
2019-07-25 21:33:06 +01:00
|
|
|
, isPy27
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvicorn";
|
2020-06-12 19:29:06 +01:00
|
|
|
version = "0.11.5";
|
2019-07-25 21:33:06 +01:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2019-09-16 23:07:28 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-06-12 19:29:06 +01:00
|
|
|
sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
|
2019-07-25 21:33:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
h11
|
|
|
|
httptools
|
|
|
|
uvloop
|
|
|
|
websockets
|
|
|
|
wsproto
|
|
|
|
];
|
|
|
|
|
2019-09-16 23:07:28 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2020-06-12 19:29:06 +01:00
|
|
|
--replace "h11==0.8.*" "h11" \
|
|
|
|
--replace "httptools==0.0.13" "httptools"
|
2019-07-25 21:33:06 +01:00
|
|
|
'';
|
|
|
|
|
2019-09-16 23:07:28 +01:00
|
|
|
checkInputs = [ pytest requests ];
|
2020-11-30 12:48:15 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-06-12 19:29:06 +01:00
|
|
|
# watchgod required the watchgod package, which isn't available in nixpkgs
|
2019-09-16 23:07:28 +01:00
|
|
|
checkPhase = ''
|
2020-11-29 19:25:40 +00:00
|
|
|
pytest --ignore=tests/supervisors/test_watchgodreload.py \
|
|
|
|
-k 'not test_supported_upgrade_request and not test_invalid_upgrade[WSProtocol]'
|
2019-09-09 19:15:41 +01:00
|
|
|
'';
|
|
|
|
|
2020-11-30 12:48:15 +00:00
|
|
|
meta = with stdenv.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 ];
|
|
|
|
};
|
|
|
|
}
|