2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-06-28 23:13:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "websockets";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "9.1";
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aaugustin";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-7Y12IUG+ulD4+CTRlY+NE6qYZyI9gCPDydwpt+uyYZk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Tests fail on Darwin with `OSError: AF_UNIX path too long`
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Disable all tests that need to terminate within a predetermined amount of
|
2021-06-28 23:13:55 +00:00
|
|
|
# time. This is nondeterministic.
|
2020-09-25 04:45:31 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
|
2021-06-28 23:13:55 +00:00
|
|
|
tests/legacy/test_protocol.py
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "websockets" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "WebSocket implementation in Python";
|
|
|
|
homepage = "https://websockets.readthedocs.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|