2020-11-30 04:48:15 -08:00
|
|
|
{ stdenv
|
2019-07-25 13:33:06 -07:00
|
|
|
, buildPythonPackage
|
2019-09-16 15:07:28 -07:00
|
|
|
, fetchFromGitHub
|
2019-07-25 13:33:06 -07:00
|
|
|
, click
|
|
|
|
, h11
|
|
|
|
, httptools
|
|
|
|
, uvloop
|
|
|
|
, websockets
|
|
|
|
, wsproto
|
2019-09-16 15:07:28 -07:00
|
|
|
, pytest
|
|
|
|
, requests
|
2019-07-25 13:33:06 -07:00
|
|
|
, isPy27
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvicorn";
|
2020-06-12 11:29:06 -07:00
|
|
|
version = "0.11.5";
|
2019-07-25 13:33:06 -07:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2019-09-16 15:07:28 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-06-12 11:29:06 -07:00
|
|
|
sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
|
2019-07-25 13:33:06 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
h11
|
|
|
|
httptools
|
|
|
|
uvloop
|
|
|
|
websockets
|
|
|
|
wsproto
|
|
|
|
];
|
|
|
|
|
2019-09-16 15:07:28 -07:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2020-06-12 11:29:06 -07:00
|
|
|
--replace "h11==0.8.*" "h11" \
|
|
|
|
--replace "httptools==0.0.13" "httptools"
|
2019-07-25 13:33:06 -07:00
|
|
|
'';
|
|
|
|
|
2019-09-16 15:07:28 -07:00
|
|
|
checkInputs = [ pytest requests ];
|
2020-11-30 04:48:15 -08:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-06-12 11:29:06 -07:00
|
|
|
# watchgod required the watchgod package, which isn't available in nixpkgs
|
2019-09-16 15:07:28 -07:00
|
|
|
checkPhase = ''
|
2020-11-29 11:25:40 -08:00
|
|
|
pytest --ignore=tests/supervisors/test_watchgodreload.py \
|
|
|
|
-k 'not test_supported_upgrade_request and not test_invalid_upgrade[WSProtocol]'
|
2019-09-09 11:15:41 -07:00
|
|
|
'';
|
|
|
|
|
2020-11-30 04:48:15 -08:00
|
|
|
meta = with stdenv.lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://www.uvicorn.org/";
|
2019-07-25 13:33:06 -07:00
|
|
|
description = "The lightning-fast ASGI server";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|