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

buildPythonPackage rec {
  pname = "hypercorn";
  version = "0.14.3";
  disabled = pythonOlder "3.7";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "pgjones";
    repo = "Hypercorn";
    rev = version;
    hash = "sha256-ECREs8UwqTWUweUrwnUwpVotCII2v4Bz7ZCk3DSAd8I=";
  };

  postPatch = ''
    sed -i "/^addopts/d" pyproject.toml
  '';

  nativeBuildInputs = [
    poetry-core
  ];

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

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

  pythonImportsCheck = [ "hypercorn" ];

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