nixpkgs/pkgs/development/python-modules/uvicorn/default.nix

59 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv
2019-07-25 21:33:06 +01:00
, 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.11.5";
2019-07-25 21:33:06 +01:00
disabled = isPy27;
src = fetchFromGitHub {
owner = "encode";
repo = pname;
rev = version;
sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
2019-07-25 21:33:06 +01:00
};
propagatedBuildInputs = [
click
h11
httptools
uvloop
websockets
wsproto
];
postPatch = ''
substituteInPlace setup.py \
--replace "h11==0.8.*" "h11" \
--replace "httptools==0.0.13" "httptools"
2019-07-25 21:33:06 +01:00
'';
checkInputs = [ pytest requests ];
doCheck = !stdenv.isDarwin;
# watchgod required the watchgod package, which isn't available in nixpkgs
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]'
'';
meta = with stdenv.lib; {
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 ];
};
}