about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/uvicorn/default.nix
blob: 36e8b12929e0e2402f00a7ac7113db6c1c206e3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, click
, h11
, httptools
, uvloop
, websockets
, wsproto
, pytestCheckHook
, pytest-mock
, pyyaml
, requests
, trustme
, typing-extensions
, isPy27
, pythonOlder
}:

buildPythonPackage rec {
  pname = "uvicorn";
  version = "0.13.2";
  disabled = isPy27;

  src = fetchFromGitHub {
    owner = "encode";
    repo = pname;
    rev = version;
    sha256 = "04zgmp9z46k72ay6cz7plga6d3w3a6x41anabm7ramp7jdqf6na9";
  };

  propagatedBuildInputs = [
    click
    h11
    httptools
    uvloop
    websockets
    wsproto
  ] ++ lib.optionals (pythonOlder "3.8") [
    typing-extensions
  ];

  checkInputs = [
    pytestCheckHook
    pytest-mock
    pyyaml
    requests
    trustme
  ];

  doCheck = !stdenv.isDarwin;

  __darwinAllowLocalNetworking = true;

  pytestFlagsArray = [
    # watchgod required the watchgod package, which isn't available in nixpkgs
    "--ignore=tests/supervisors/test_reload.py"
  ];

  disabledTests = [
    "test_supported_upgrade_request"
    "test_invalid_upgrade"
  ];

  meta = with lib; {
    homepage = "https://www.uvicorn.org/";
    description = "The lightning-fast ASGI server";
    license = licenses.bsd3;
    maintainers = with maintainers; [ wd15 ];
  };
}