summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/eventlet/default.nix
blob: 4b84afbc61756c06a2dd637e0efe2467526174d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  hatch-vcs,
  hatchling,

  # dependencies
  dnspython,
  greenlet,
  isPyPy,
  six,

  # tests
  iana-etc,
  pytestCheckHook,
  libredirect,
}:

buildPythonPackage rec {
  pname = "eventlet";
  version = "0.40.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "eventlet";
    repo = "eventlet";
    tag = version;
    hash = "sha256-yieyNx91jvKoh02zDFIEFk70yf3I27DWiumqoOjtdzQ=";
  };

  pythonRelaxDeps = lib.optionals isPyPy [ "greenlet" ];

  build-system = [
    hatch-vcs
    hatchling
  ];

  dependencies = [
    dnspython
    greenlet
    six
  ];

  nativeCheckInputs = [
    libredirect.hook
    pytestCheckHook
  ];

  # tests hang on pypy indefinitely
  # most tests also fail/flake on Darwin
  doCheck = !isPyPy && !stdenv.hostPlatform.isDarwin;

  preCheck = lib.optionalString doCheck ''
    echo "nameserver 127.0.0.1" > resolv.conf
    export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf)

    export EVENTLET_IMPORT_VERSION_ONLY=0
  '';

  disabledTests = [
    # AssertionError: Expected single line "pass" in stdout
    "test_fork_after_monkey_patch"
    # Tests requires network access
    "test_getaddrinfo"
    "test_hosts_no_network"
    # flaky test, depends on builder performance
    "test_server_connection_timeout_exception"
    # broken with openssl 3.4
    "test_ssl_close"
    # flaky test
    "test_send_timeout"
  ];

  pythonImportsCheck = [ "eventlet" ];

  meta = {
    changelog = "https://github.com/eventlet/eventlet/blob/${src.tag}/NEWS";
    description = "Concurrent networking library for Python";
    homepage = "https://github.com/eventlet/eventlet/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ SuperSandro2000 ];
  };
}