Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / python-engineio / default.nix
blob952893fec269c21a17dd3da13655b19a03e6c886
1 { lib
2 , stdenv
3 , aiohttp
4 , buildPythonPackage
5 , setuptools
6 , eventlet
7 , fetchFromGitHub
8 , iana-etc
9 , libredirect
10 , mock
11 , pytestCheckHook
12 , pythonOlder
13 , requests
14 , simple-websocket
15 , tornado
16 , websocket-client
19 buildPythonPackage rec {
20   pname = "python-engineio";
21   version = "4.9.0";
22   pyproject = true;
24   disabled = pythonOlder "3.6";
26   src = fetchFromGitHub {
27     owner = "miguelgrinberg";
28     repo = "python-engineio";
29     rev = "refs/tags/v${version}";
30     hash = "sha256-FpPGIK5HVtTzDOpORo+WPhS1860P3dm1nJkvakpzsjE=";
31   };
33   nativeBuildInputs = [
34     setuptools
35   ];
37   propagatedBuildInputs = [
38     simple-websocket
39   ];
41   passthru.optional-dependencies = {
42     client = [
43       requests
44       websocket-client
45     ];
46     asyncio_client = [
47       aiohttp
48     ];
49   };
51   nativeCheckInputs = [
52     aiohttp
53     eventlet
54     mock
55     requests
56     tornado
57     websocket-client
58     pytestCheckHook
59   ];
61   doCheck = !stdenv.isDarwin;
63   preCheck = lib.optionalString stdenv.isLinux ''
64     echo "nameserver 127.0.0.1" > resolv.conf
65     export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) \
66       LD_PRELOAD=${libredirect}/lib/libredirect.so
67   '';
69   postCheck = ''
70     unset NIX_REDIRECTS LD_PRELOAD
71   '';
73   # somehow effective log level does not change?
74   disabledTests = [
75     "test_logger"
76   ];
78   pythonImportsCheck = [
79     "engineio"
80   ];
82   meta = with lib; {
83     description = "Python based Engine.IO client and server";
84     longDescription = ''
85       Engine.IO is a lightweight transport protocol that enables real-time
86       bidirectional event-based communication between clients and a server.
87     '';
88     homepage = "https://github.com/miguelgrinberg/python-engineio/";
89     changelog = "https://github.com/miguelgrinberg/python-engineio/blob/v${version}/CHANGES.md";
90     license = with licenses; [ mit ];
91     maintainers = with maintainers; [ mic92 ];
92   };