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