nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, pythonOlder
6, dnspython
7, greenlet
8, monotonic
9, six
10, nose
11, pyopenssl
12, iana-etc
13, pytestCheckHook
14, libredirect
15}:
16
17buildPythonPackage rec {
18 pname = "eventlet";
19 version = "0.33.0";
20 format = "setuptools";
21
22 src = fetchFromGitHub {
23 owner = "eventlet";
24 repo = pname;
25 rev = "v${version}";
26 hash = "sha256-kE/eYBbaTt1mPGoUIMhonvFBlQOdAfPU5GvCvPaRHvs=";
27 };
28
29 propagatedBuildInputs = [
30 dnspython
31 greenlet
32 pyopenssl
33 six
34 ] ++ lib.optional (pythonOlder "3.5") [
35 monotonic
36 ];
37
38 checkInputs = [
39 pytestCheckHook
40 nose
41 ];
42
43 doCheck = !stdenv.isDarwin;
44
45 preCheck = lib.optionalString doCheck ''
46 echo "nameserver 127.0.0.1" > resolv.conf
47 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
48 export LD_PRELOAD=${libredirect}/lib/libredirect.so
49
50 export EVENTLET_IMPORT_VERSION_ONLY=0
51 '';
52
53 disabledTests = [
54 # Tests requires network access
55 "test_017_ssl_zeroreturnerror"
56 "test_getaddrinfo"
57 "test_hosts_no_network"
58 "test_leakage_from_tracebacks"
59 "test_patcher_existing_locks_locked"
60 # broken with pyopenssl 22.0.0
61 "test_sendall_timeout"
62 ] ++ lib.optionals stdenv.isAarch64 [
63 "test_fork_after_monkey_patch"
64 ];
65
66 disabledTestPaths = [
67 # Tests are out-dated
68 "tests/stdlib/test_asynchat.py"
69 "tests/stdlib/test_asyncore.py"
70 "tests/stdlib/test_ftplib.py"
71 "tests/stdlib/test_httplib.py"
72 "tests/stdlib/test_httpservers.py"
73 "tests/stdlib/test_os.py"
74 "tests/stdlib/test_queue.py"
75 "tests/stdlib/test_select.py"
76 "tests/stdlib/test_SimpleHTTPServer.py"
77 "tests/stdlib/test_socket_ssl.py"
78 "tests/stdlib/test_socket.py"
79 "tests/stdlib/test_socketserver.py"
80 "tests/stdlib/test_ssl.py"
81 "tests/stdlib/test_subprocess.py"
82 "tests/stdlib/test_thread__boundedsem.py"
83 "tests/stdlib/test_thread.py"
84 "tests/stdlib/test_threading_local.py"
85 "tests/stdlib/test_threading.py"
86 "tests/stdlib/test_timeout.py"
87 "tests/stdlib/test_urllib.py"
88 "tests/stdlib/test_urllib2_localnet.py"
89 "tests/stdlib/test_urllib2.py"
90 ];
91
92 # unfortunately, it needs /etc/protocol to be present to not fail
93 # pythonImportsCheck = [ "eventlet" ];
94
95 meta = with lib; {
96 description = "A concurrent networking library for Python";
97 homepage = "https://github.com/eventlet/eventlet/";
98 license = licenses.mit;
99 maintainers = with maintainers; [ SuperSandro2000 ];
100 };
101}