Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / python-engineio / default.nix
blob990cbd1be317ea3d5d7ee73170857984e20b2d35
1 { lib
2 , stdenv
3 , aiohttp
4 , buildPythonPackage
5 , eventlet
6 , fetchFromGitHub
7 , iana-etc
8 , libredirect
9 , mock
10 , pytestCheckHook
11 , pythonOlder
12 , requests
13 , simple-websocket
14 , tornado
15 , websocket-client
18 buildPythonPackage rec {
19   pname = "python-engineio";
20   version = "4.7.1";
21   format = "setuptools";
23   disabled = pythonOlder "3.6";
25   src = fetchFromGitHub {
26     owner = "miguelgrinberg";
27     repo = "python-engineio";
28     rev = "refs/tags/v${version}";
29     hash = "sha256-jHXpPnrQlIpmQ2sY4y6AUx/6W8Pf+683s4NmmlwZO58=";
30   };
32   propagatedBuildInputs = [
33     simple-websocket
34   ];
36   passthru.optional-dependencies = {
37     client = [
38       requests
39       websocket-client
40     ];
41     asyncio_client = [
42       aiohttp
43     ];
44   };
46   nativeCheckInputs = [
47     aiohttp
48     eventlet
49     mock
50     requests
51     tornado
52     websocket-client
53     pytestCheckHook
54   ];
56   doCheck = !stdenv.isDarwin;
58   preCheck = lib.optionalString stdenv.isLinux ''
59     echo "nameserver 127.0.0.1" > resolv.conf
60     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) \
61       LD_PRELOAD=${libredirect}/lib/libredirect.so
62   '';
64   postCheck = ''
65     unset NIX_REDIRECTS LD_PRELOAD
66   '';
68   # somehow effective log level does not change?
69   disabledTests = [
70     "test_logger"
71   ];
73   pythonImportsCheck = [
74     "engineio"
75   ];
77   meta = with lib; {
78     description = "Python based Engine.IO client and server";
79     longDescription = ''
80       Engine.IO is a lightweight transport protocol that enables real-time
81       bidirectional event-based communication between clients and a server.
82     '';
83     homepage = "https://github.com/miguelgrinberg/python-engineio/";
84     changelog = "https://github.com/miguelgrinberg/python-engineio/blob/v${version}/CHANGES.md";
85     license = with licenses; [ mit ];
86     maintainers = with maintainers; [ mic92 ];
87   };