2019-07-25 22:33:06 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-09-17 00:07:28 +02:00
|
|
|
, fetchFromGitHub
|
2019-07-25 22:33:06 +02:00
|
|
|
, click
|
|
|
|
, h11
|
|
|
|
, httptools
|
|
|
|
, uvloop
|
|
|
|
, websockets
|
|
|
|
, wsproto
|
2019-09-17 00:07:28 +02:00
|
|
|
, pytest
|
|
|
|
, requests
|
2019-07-25 22:33:06 +02:00
|
|
|
, isPy27
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "uvicorn";
|
2020-02-02 06:30:14 +01:00
|
|
|
version = "0.11.2";
|
2019-07-25 22:33:06 +02:00
|
|
|
disabled = isPy27;
|
|
|
|
|
2019-09-17 00:07:28 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-02-02 06:30:14 +01:00
|
|
|
sha256 = "145c569j4511zw3wglyv9qgd7g1757ypi2blcckpcmahqw11l5p2";
|
2019-07-25 22:33:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
h11
|
|
|
|
httptools
|
|
|
|
uvloop
|
|
|
|
websockets
|
|
|
|
wsproto
|
|
|
|
];
|
|
|
|
|
2019-09-17 00:07:28 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "h11==0.8.*" "h11"
|
2019-07-25 22:33:06 +02:00
|
|
|
'';
|
|
|
|
|
2019-09-17 00:07:28 +02:00
|
|
|
checkInputs = [ pytest requests ];
|
|
|
|
checkPhase = ''
|
|
|
|
pytest
|
|
|
|
'';
|
2019-07-25 22:33:06 +02:00
|
|
|
|
2019-09-09 20:15:41 +02:00
|
|
|
# LICENCE.md gets propagated without this, causing collisions
|
|
|
|
# see https://github.com/encode/uvicorn/issues/392
|
|
|
|
postInstall = ''
|
|
|
|
rm $out/LICENSE.md
|
|
|
|
'';
|
|
|
|
|
2019-07-25 22:33:06 +02:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.uvicorn.org/";
|
2019-07-25 22:33:06 +02:00
|
|
|
description = "The lightning-fast ASGI server";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|