1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/uvicorn/default.nix

59 lines
1,016 B
Nix
Raw Normal View History

2019-07-25 21:33:06 +01:00
{ lib
, buildPythonPackage
, fetchFromGitHub
2019-07-25 21:33:06 +01:00
, click
, h11
, httptools
, uvloop
, websockets
, wsproto
, pytest
, requests
2019-07-25 21:33:06 +01:00
, isPy27
}:
buildPythonPackage rec {
pname = "uvicorn";
version = "0.9.0";
2019-07-25 21:33:06 +01:00
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "0z4h04mbkzqgpk698bac6f50jxkf02ils6khzl7zbw7yvi6gkkc8";
2019-07-25 21:33:06 +01:00
};
propagatedBuildInputs = [
click
h11
httptools
uvloop
websockets
wsproto
];
postPatch = ''
substituteInPlace setup.py \
--replace "h11==0.8.*" "h11"
2019-07-25 21:33:06 +01:00
'';
checkInputs = [ pytest requests ];
checkPhase = ''
pytest
'';
2019-07-25 21:33:06 +01: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 21:33:06 +01:00
meta = with lib; {
homepage = https://www.uvicorn.org/;
description = "The lightning-fast ASGI server";
license = licenses.bsd3;
maintainers = with maintainers; [ wd15 ];
};
}