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.11.5";
18 disabled = isPy27;
19
20 src = fetchFromGitHub {
21 owner = "encode";
22 repo = pname;
23 rev = version;
24 sha256 = "0cf0vw6kzxwlkvk5gw85wv3kg1kdil0wkq3s7rmxpvrk6gjk8jvq";
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 --replace "httptools==0.0.13" "httptools"
40 '';
41
42 checkInputs = [ pytest requests ];
43 # watchgod required the watchgod package, which isn't available in nixpkgs
44 checkPhase = ''
45 pytest --ignore=tests/supervisors/test_watchgodreload.py
46 '';
47
48 meta = with lib; {
49 homepage = "https://www.uvicorn.org/";
50 description = "The lightning-fast ASGI server";
51 license = licenses.bsd3;
52 maintainers = with maintainers; [ wd15 ];
53 };
54}