1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, click
5, h11
6, httptools
7, uvloop
8, websockets
9, wsproto
10, pytest
11, requests
12, isPy27
13}:
14
15buildPythonPackage rec {
16 pname = "uvicorn";
17 version = "0.9.0";
18 disabled = isPy27;
19
20 src = fetchFromGitHub {
21 owner = "encode";
22 repo = pname;
23 rev = version;
24 sha256 = "0z4h04mbkzqgpk698bac6f50jxkf02ils6khzl7zbw7yvi6gkkc8";
25 };
26
27 propagatedBuildInputs = [
28 click
29 h11
30 httptools
31 uvloop
32 websockets
33 wsproto
34 ];
35
36 postPatch = ''
37 substituteInPlace setup.py \
38 --replace "h11==0.8.*" "h11"
39 '';
40
41 checkInputs = [ pytest requests ];
42 checkPhase = ''
43 pytest
44 '';
45
46 meta = with lib; {
47 homepage = https://www.uvicorn.org/;
48 description = "The lightning-fast ASGI server";
49 license = licenses.bsd3;
50 maintainers = with maintainers; [ wd15 ];
51 };
52}