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
|
|
|
, pythonAtLeast
|
|
|
|
|
|
|
|
# build-system
|
2024-04-21 15:54:59 +00:00
|
|
|
, hatch-vcs
|
|
|
|
, hatchling
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
# 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
|
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";
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
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-04-21 15:54:59 +00:00
|
|
|
doCheck = !stdenv.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";
|
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
|
|
|
};
|
|
|
|
}
|