2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
hatch-vcs,
|
|
|
|
hatchling,
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
dnspython,
|
|
|
|
greenlet,
|
|
|
|
isPyPy,
|
|
|
|
six,
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
iana-etc,
|
|
|
|
pytestCheckHook,
|
|
|
|
libredirect,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "eventlet";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.35.2";
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "eventlet";
|
2022-01-13 20:06:32 +00:00
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-jMbCxqIn9f9+16rFwpQdkBHj6NwTNkQxnSVV4qQ1fjM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
dnspython
|
|
|
|
greenlet
|
|
|
|
six
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
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-09-26 11:04:55 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin && !isPyPy;
|
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 = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# AssertionError: Expected single line "pass" in stdout
|
|
|
|
"test_fork_after_monkey_patch"
|
2022-01-13 20:06:32 +00:00
|
|
|
# Tests requires network access
|
|
|
|
"test_getaddrinfo"
|
|
|
|
"test_hosts_no_network"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +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";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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
|
|
|
};
|
|
|
|
}
|