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
|
2024-01-13 08:15:51 +00:00
|
|
|
, fetchpatch
|
|
|
|
, pythonAtLeast
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# dependencies
|
2020-04-24 23:36:52 +00:00
|
|
|
, dnspython
|
|
|
|
, greenlet
|
2023-08-10 07:59:29 +00:00
|
|
|
, isPyPy
|
2020-04-24 23:36:52 +00:00
|
|
|
, six
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# tests
|
2023-08-10 07:59:29 +00:00
|
|
|
, nose3
|
2021-09-18 10:52:07 +00:00
|
|
|
, 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";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.33.3";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
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}";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-iSSEZgPkK7RrZfU11z7hUk+JbFsCPH/SD16e+/f6TFU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
# Python 3.12 fixes:
|
|
|
|
# - remove usage of distutils
|
|
|
|
# - replace ssl.wrap_socket usage
|
|
|
|
./remove-distutils-usage.patch
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://src.fedoraproject.org/rpms/python-eventlet/raw/rawhide/f/python3.12.patch";
|
|
|
|
hash = "sha256-MxzprFaVcV1uamjjTeIz+2gPvfPy+Y1QaA20znMdwoA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
dnspython
|
|
|
|
greenlet
|
|
|
|
six
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
pytestCheckHook
|
2023-08-10 07:59:29 +00:00
|
|
|
nose3
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
# libredirect is not available on darwin
|
|
|
|
# tests hang on pypy indefinitely
|
2024-01-13 08:15:51 +00:00
|
|
|
# nose3 is incompatible with Python 3.12.
|
|
|
|
doCheck = !stdenv.isDarwin && !isPyPy && !(pythonAtLeast "3.12");
|
2021-09-18 10:52:07 +00:00
|
|
|
|
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"
|
2022-08-21 13:32:41 +00:00
|
|
|
"test_018b_http_10_keepalive_framing"
|
2022-01-13 20:06:32 +00:00
|
|
|
"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"
|
2023-03-04 12:14:45 +00:00
|
|
|
# broken on aarch64 and when using march in gcc
|
2022-05-18 14:49:53 +00:00
|
|
|
"test_fork_after_monkey_patch"
|
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; {
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/eventlet/eventlet/blob/v${version}/NEWS";
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|