1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 packaging,
12
13 # optional-dependencies
14 eventlet,
15 gevent,
16 tornado,
17 setproctitle,
18
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "gunicorn";
24 version = "21.2.0";
25 pyproject = true;
26
27 disabled = pythonOlder "3.5";
28
29 src = fetchFromGitHub {
30 owner = "benoitc";
31 repo = "gunicorn";
32 rev = version;
33 hash = "sha256-xP7NNKtz3KNrhcAc00ovLZRx2h6ZqHbwiFOpCiuwf98=";
34 };
35
36 postPatch = ''
37 substituteInPlace setup.cfg \
38 --replace "--cov=gunicorn --cov-report=xml" ""
39 '';
40
41 nativeBuildInputs = [ setuptools ];
42
43 propagatedBuildInputs = [ packaging ];
44
45 passthru.optional-dependencies = {
46 gevent = [ gevent ];
47 eventlet = [ eventlet ];
48 tornado = [ tornado ];
49 gthread = [ ];
50 setproctitle = [ setproctitle ];
51 };
52
53 pythonImportsCheck = [ "gunicorn" ];
54
55 nativeCheckInputs = [
56 pytestCheckHook
57 ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
58
59 meta = with lib; {
60 changelog = "https://github.com/benoitc/gunicorn/releases/tag/${version}";
61 homepage = "https://github.com/benoitc/gunicorn";
62 description = "gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications";
63 license = licenses.mit;
64 maintainers = with maintainers; [ ];
65 mainProgram = "gunicorn";
66 };
67}