1{ lib
2, fetchPypi
3, fetchpatch
4, buildPythonPackage
5, isPyPy
6, python
7, libev
8, cffi
9, cython_3
10, greenlet
11, importlib-metadata
12, setuptools
13, wheel
14, zope_event
15, zope_interface
16, pythonOlder
17}:
18
19buildPythonPackage rec {
20 pname = "gevent";
21 version = "22.10.2";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-HKAdoXbuN7NSeicC99QNvJ/7jPx75aA7+k+e7EXlXEY=";
29 };
30
31 patches = [
32 # Replace deprecated pkg_resources with importlib-metadata
33 (fetchpatch {
34 url = "https://github.com/gevent/gevent/commit/bd96d8e14dc99f757de22ab4bb98439f912dab1e.patch";
35 hash = "sha256-Y+cxIScuEgAVYmmxBJ8OI+JuJ4G+iiROTcRdWglo3l0=";
36 includes = [ "src/gevent/events.py" ];
37 })
38 ];
39
40 nativeBuildInputs = [
41 cython_3
42 setuptools
43 wheel
44 ] ++ lib.optionals (!isPyPy) [
45 cffi
46 ];
47
48 buildInputs = [
49 libev
50 ];
51
52 propagatedBuildInputs = [
53 importlib-metadata
54 zope_event
55 zope_interface
56 ] ++ lib.optionals (!isPyPy) [
57 greenlet
58 ];
59
60 # Bunch of failures.
61 doCheck = false;
62
63 pythonImportsCheck = [
64 "gevent"
65 "gevent.events"
66 ];
67
68 meta = with lib; {
69 description = "Coroutine-based networking library";
70 homepage = "http://www.gevent.org/";
71 license = licenses.mit;
72 maintainers = with maintainers; [ bjornfor ];
73 platforms = platforms.unix;
74 };
75}