1{
2 stdenv,
3 lib,
4 fetchPypi,
5 buildPythonPackage,
6 isPyPy,
7 python,
8 libev,
9 cffi,
10 cython,
11 greenlet,
12 importlib-metadata,
13 setuptools,
14 wheel,
15 zope-event,
16 zope-interface,
17 pythonOlder,
18 c-ares,
19 libuv,
20
21 # for passthru.tests
22 dulwich,
23 gunicorn,
24 pika,
25}:
26
27buildPythonPackage rec {
28 pname = "gevent";
29 version = "24.11.1";
30 format = "pyproject";
31
32 disabled = pythonOlder "3.7";
33
34 src = fetchPypi {
35 inherit pname version;
36 hash = "sha256-i9FBkRTp5KPtM6W612av/5o892XLRApYKhs6m8gMGso=";
37 };
38
39 nativeBuildInputs = [
40 cython
41 setuptools
42 wheel
43 ]
44 ++ lib.optionals (!isPyPy) [ cffi ];
45
46 buildInputs = [
47 libev
48 libuv
49 c-ares
50 ];
51
52 propagatedBuildInputs = [
53 importlib-metadata
54 zope-event
55 zope-interface
56 ]
57 ++ lib.optionals (!isPyPy) [ greenlet ];
58
59 env = lib.optionalAttrs stdenv.cc.isGNU {
60 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
61 };
62
63 # Bunch of failures.
64 doCheck = false;
65
66 pythonImportsCheck = [
67 "gevent"
68 "gevent.events"
69 ];
70
71 passthru.tests = {
72 inherit
73 dulwich
74 gunicorn
75 pika
76 ;
77 }
78 // lib.filterAttrs (k: v: lib.hasInfix "gevent" k) python.pkgs;
79
80 GEVENTSETUP_EMBED = "0";
81
82 meta = with lib; {
83 description = "Coroutine-based networking library";
84 homepage = "http://www.gevent.org/";
85 license = licenses.mit;
86 maintainers = with maintainers; [ bjornfor ];
87 platforms = platforms.unix;
88 };
89}