2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-09-18 10:52:07 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-01-13 20:06:32 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, dnspython
|
|
|
|
, greenlet
|
|
|
|
, monotonic
|
|
|
|
, six
|
|
|
|
, nose
|
2021-09-18 10:52:07 +00:00
|
|
|
, pyopenssl
|
|
|
|
, iana-etc
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytestCheckHook
|
2021-09-18 10:52:07 +00:00
|
|
|
, libredirect
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "eventlet";
|
2021-12-26 17:43:05 +00:00
|
|
|
version = "0.33.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "eventlet";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-kE/eYBbaTt1mPGoUIMhonvFBlQOdAfPU5GvCvPaRHvs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
dnspython
|
|
|
|
greenlet
|
|
|
|
pyopenssl
|
|
|
|
six
|
|
|
|
] ++ lib.optional (pythonOlder "3.5") [
|
|
|
|
monotonic
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
nose
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
preCheck = lib.optionalString doCheck ''
|
2021-09-18 10:52:07 +00:00
|
|
|
echo "nameserver 127.0.0.1" > resolv.conf
|
|
|
|
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)
|
|
|
|
export LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
|
|
|
|
export EVENTLET_IMPORT_VERSION_ONLY=0
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests requires network access
|
|
|
|
"test_017_ssl_zeroreturnerror"
|
|
|
|
"test_getaddrinfo"
|
|
|
|
"test_hosts_no_network"
|
|
|
|
"test_leakage_from_tracebacks"
|
|
|
|
"test_patcher_existing_locks_locked"
|
2022-03-30 09:31:56 +00:00
|
|
|
# broken with pyopenssl 22.0.0
|
|
|
|
"test_sendall_timeout"
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests are out-dated
|
|
|
|
"tests/stdlib/test_asynchat.py"
|
|
|
|
"tests/stdlib/test_asyncore.py"
|
|
|
|
"tests/stdlib/test_ftplib.py"
|
|
|
|
"tests/stdlib/test_httplib.py"
|
|
|
|
"tests/stdlib/test_httpservers.py"
|
|
|
|
"tests/stdlib/test_os.py"
|
|
|
|
"tests/stdlib/test_queue.py"
|
|
|
|
"tests/stdlib/test_select.py"
|
|
|
|
"tests/stdlib/test_SimpleHTTPServer.py"
|
|
|
|
"tests/stdlib/test_socket_ssl.py"
|
|
|
|
"tests/stdlib/test_socket.py"
|
|
|
|
"tests/stdlib/test_socketserver.py"
|
|
|
|
"tests/stdlib/test_ssl.py"
|
|
|
|
"tests/stdlib/test_subprocess.py"
|
|
|
|
"tests/stdlib/test_thread__boundedsem.py"
|
|
|
|
"tests/stdlib/test_thread.py"
|
|
|
|
"tests/stdlib/test_threading_local.py"
|
|
|
|
"tests/stdlib/test_threading.py"
|
|
|
|
"tests/stdlib/test_timeout.py"
|
|
|
|
"tests/stdlib/test_urllib.py"
|
|
|
|
"tests/stdlib/test_urllib2_localnet.py"
|
|
|
|
"tests/stdlib/test_urllib2.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# unfortunately, it needs /etc/protocol to be present to not fail
|
2021-09-18 10:52:07 +00:00
|
|
|
# pythonImportsCheck = [ "eventlet" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A concurrent networking library for Python";
|
2022-01-13 20:06:32 +00:00
|
|
|
homepage = "https://github.com/eventlet/eventlet/";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.mit;
|
2022-01-13 20:06:32 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|