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-09-18 10:52:07 +00:00
|
|
|
version = "0.32.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "2f0bb8ed0dc0ab21d683975d5d8ab3c054d588ce61def9faf7a465ee363e839b";
|
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;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
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
|
|
|
|
|
|
|
|
nosetests --exclude test_getaddrinfo --exclude test_hosts_no_network
|
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
|
|
|
};
|
|
|
|
}
|