2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, aiohttp
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, eventlet
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, iana-etc
|
|
|
|
, libredirect
|
|
|
|
, mock
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests
|
|
|
|
, tornado
|
2021-06-28 23:13:55 +00:00
|
|
|
, websocket-client
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-engineio";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "4.3.4";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "miguelgrinberg";
|
|
|
|
repo = "python-engineio";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
hash = "sha256-fymO9WqkYaRsHKCJHQJpySHqZor2t8BfVrfYUfYoJno=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
patches = [
|
|
|
|
# Address Python 3.11 mocking issue, https://github.com/miguelgrinberg/python-engineio/issues/279
|
|
|
|
(fetchpatch {
|
|
|
|
name = "mocking-issue-py311.patch";
|
|
|
|
url = "https://github.com/miguelgrinberg/python-engineio/commit/ac3911356fbe933afa7c11d56141f0e228c01528.patch";
|
|
|
|
hash = "sha256-LNMhjX8kqOI3y8XugCHxCPEC6lF83NROfIczXWiLuqY=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
aiohttp
|
|
|
|
eventlet
|
|
|
|
mock
|
|
|
|
requests
|
|
|
|
tornado
|
2021-06-28 23:13:55 +00:00
|
|
|
websocket-client
|
2020-09-25 04:45:31 +00:00
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preCheck = lib.optionalString stdenv.isLinux ''
|
2020-09-25 04:45:31 +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) \
|
2020-04-24 23:36:52 +00:00
|
|
|
LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
unset NIX_REDIRECTS LD_PRELOAD
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# somehow effective log level does not change?
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_logger"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"engineio"
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 10:05:03 +00:00
|
|
|
description = "Python based Engine.IO client and server";
|
|
|
|
longDescription = ''
|
|
|
|
Engine.IO is a lightweight transport protocol that enables real-time
|
|
|
|
bidirectional event-based communication between clients and a server.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/miguelgrinberg/python-engineio/";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/miguelgrinberg/python-engineio/blob/v${version}/CHANGES.md";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|