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
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, dnspython
|
|
|
|
, greenlet
|
|
|
|
, monotonic
|
|
|
|
, six
|
|
|
|
, nose
|
2021-09-18 10:52:07 +00:00
|
|
|
, pyopenssl
|
|
|
|
, iana-etc
|
|
|
|
, 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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-26 17:43:05 +00:00
|
|
|
sha256 = "80144f489c1bb273a51b6f96ff9785a382d2866b9bab1f5bd748385019f4141f";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
propagatedBuildInputs = [ dnspython greenlet pyopenssl six ]
|
|
|
|
++ lib.optional (pythonOlder "3.5") monotonic;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkInputs = [ nose ];
|
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# test_fork-after_monkey_patch fails on aarch64 on hydra only
|
|
|
|
# AssertionError: Expected single line "pass" in stdout
|
|
|
|
nosetests --exclude test_getaddrinfo --exclude test_hosts_no_network --exclude test_fork_after_monkey_patch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
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; {
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://github.com/eventlet/eventlet/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A concurrent networking library for Python";
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|