1{ lib, stdenv
2, buildPythonPackage
3, fetchFromGitHub
4, aiohttp
5, eventlet
6, iana-etc
7, libredirect
8, mock
9, requests
10, six
11, tornado
12, websocket_client
13, websockets
14, pytestCheckHook
15}:
16
17buildPythonPackage rec {
18 pname = "python-engineio";
19 version = "4.0.0";
20
21 src = fetchFromGitHub {
22 owner = "miguelgrinberg";
23 repo = "python-engineio";
24 rev = "v${version}";
25 sha256 = "00x9pmmnl1yd59wd96ivkiqh4n5nphl8cwk43hf4nqr0icgsyhar";
26 };
27
28 checkInputs = [
29 aiohttp
30 eventlet
31 mock
32 requests
33 tornado
34 websocket_client
35 websockets
36 pytestCheckHook
37 ];
38
39 doCheck = !stdenv.isDarwin;
40
41 preCheck = lib.optionalString stdenv.isLinux ''
42 echo "nameserver 127.0.0.1" > resolv.conf
43 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) \
44 LD_PRELOAD=${libredirect}/lib/libredirect.so
45 '';
46 postCheck = "unset NIX_REDIRECTS LD_PRELOAD";
47
48 # somehow effective log level does not change?
49 disabledTests = [ "test_logger" ];
50 pythonImportsCheck = [ "engineio" ];
51
52 meta = with lib; {
53 description = "Python based Engine.IO client and server";
54 longDescription = ''
55 Engine.IO is a lightweight transport protocol that enables real-time
56 bidirectional event-based communication between clients and a server.
57 '';
58 homepage = "https://github.com/miguelgrinberg/python-engineio/";
59 license = with licenses; [ mit ];
60 maintainers = with maintainers; [ mic92 ];
61 };
62}