about summary refs log tree commit diff
path: root/pkgs/development/python-modules/hypercorn/default.nix
blob: 35a9f8f6bb85986d12a86eaaa49e391ab8a92baa (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
{ lib
, buildPythonPackage
, fetchFromGitLab
, pythonOlder
, typing-extensions
, wsproto
, toml
, h2
, priority
, mock
, poetry-core
, pytest-asyncio
, pytest-cov
, pytest-sugar
, pytest-trio
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "Hypercorn";
  version = "0.13.2";
  disabled = pythonOlder "3.7";
  format = "pyproject";

  src = fetchFromGitLab {
    owner = "pgjones";
    repo = pname;
    rev = version;
    sha256 = "sha256-fIjw5A6SvFUv8cU7xunVlPYphv+glypY4pzvHNifYLQ=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [ wsproto toml h2 priority ]
    ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ];

  checkInputs = [
    pytest-asyncio
    pytest-cov
    pytest-sugar
    pytest-trio
    pytestCheckHook
  ] ++ lib.optionals (pythonOlder "3.8") [ mock ];

  pytestFlagsArray = [
    "--asyncio-mode=legacy"
  ];

  pythonImportsCheck = [ "hypercorn" ];

  meta = with lib; {
    homepage = "https://pgjones.gitlab.io/hypercorn/";
    description = "The ASGI web server inspired by Gunicorn";
    license = licenses.mit;
    maintainers = with maintainers; [ dgliwka ];
  };
}