My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nomicon/pkgs/development/python-modules/eventlet/default.nix

58 lines
1.3 KiB

{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, dnspython
, greenlet
, monotonic
, six
, nose
, pyopenssl
, iana-etc
, libredirect
}:
buildPythonPackage rec {
pname = "eventlet";
version = "0.32.0";
src = fetchPypi {
inherit pname version;
sha256 = "2f0bb8ed0dc0ab21d683975d5d8ab3c054d588ce61def9faf7a465ee363e839b";
};
propagatedBuildInputs = [ dnspython greenlet pyopenssl six ]
++ lib.optional (pythonOlder "3.5") monotonic;
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
'';
checkPhase = ''
runHook preCheck
nosetests --exclude test_getaddrinfo --exclude test_hosts_no_network
runHook postCheck
'';
# unfortunately, it needs /etc/protocol to be present to not fail
# pythonImportsCheck = [ "eventlet" ];
meta = with lib; {
homepage = "https://github.com/eventlet/eventlet/";
description = "A concurrent networking library for Python";
maintainers = with maintainers; [ SuperSandro2000 ];
license = licenses.mit;
};
}